How to Send Outbound Traffic With Different IP?

edited June 2019 in Help

I have a VM with 2 IPv4 addresses.

Main IP:
Second IP:

> When I do HTTP request, it uses Main IP ( to send outbound traffic.
> I want to route some requests which are sent to specific host with using my second IP (
> 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

In here 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.


  • 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.