How to Send Outbound Traffic With Different IP?

edited June 10 in Help
Hello,

I have a VM with 2 IPv4 addresses.

Main IP: 139.180.214.xxx
Second IP: 45.32.121.xxx

> When I do HTTP request, it uses Main IP (139.180.214.xxx) to send outbound traffic.
> I want to route some requests which are sent to specific host with using my second IP (45.32.121.xxx).
> I tried to use ip route, but doesn't work. Maybe it caused by the second IP doesn't have a gateway.

This is the command I've tried:
sudo ip route [target_host] via 45.32.121.xxx

In here 45.32.121.xxx is my second IP address, I think it should be the gateway of the second IP address, but it doesn't have a gateway.

How can I do it?

Please help me, thank you in advance.

Comments

  • I use Squid for this on my FreeBSD instance. Then again, I'm not sure what your trying to accomplish.
Sign In or Register to comment.