This is probably a silly question.
I'm doing some http requests using wget
from the command line, and I want those connections to be made through one specific IP of the 4 IPs my server has.
Those http requests go to one specific range of IPs so I only want those to be routed differently.
The 4 interfaces in my server are eth0
, eth0:0
, eth0:1
, eth0:2
.
I tried with the following command:
route add -net 192.164.10.0/24 dev eth0:0
But when I see the routing table it says:
Destination Gateway Genmask Flags MSS Window irtt Iface
192.164.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
The interface is set to eth0
not eth0:0
as my command says.
What am I doing wrong?
wget --bind-address=192.0.2.116 http://file
fromman wget
If it's not wget, then there's this nifty little wrapper that you use
LD_PRELOAD
to insert before you run any command.You can use that to specifically bind, say, a browser to a VLAN interface (speaking from experience).
You could try to setup PBR (policy base routing) if you need more flexible routing (instead of --bind-address)
And then use something like following