Re: Force an application to use the IP I want for outgoing packets



On Jan 22, 12:52 pm, Gdss <g...@xxxxxxxxxxx> wrote:
Hello everybody,

I'm in a situation where I have 2 network interfaces, each one has a public
ip address, and the default route is set on the interface 0.

If I wanted to use interface 1 for the application I'm about to launch, how
could I do?

Let's imagine I want to do a ping using as source address the IP of the
interface 1, and I want packets generated by it routed through interface 1.
Is that possible?
-It's all about routing man, I use the ping command with -i only when
I have 2 gateways to the Internet, And this setup called multipath
routing or dual routing, Check www.lartc.org for details.
-But if you don't have 2 Internet connections so why you use -i or
whatever, The Linux routing table will lead the application to it's
destination as it should go according to the routing table. You can
force your system to go through a specific interface when you want to
reach specific host through this interface with the route command
like, route add -host 11.22.33.44 gw 192.168.1.2, This way your system
will go to 11.22.33.44 through 192.168.1.2 interface. I wish I could
help someway.
I tried doing "ping -I <address of interface 1> destination" and it seems to
work. I also tried to do an ssh -b <address of interface 1> destination,
but it doesn't work.

Any hints?
Thank you very much.
Regards,
.



Relevant Pages

  • Re: DECWindows SET/DISPLAY & CREATE/TERM/DETACH problem on Alphaserver DS10L
    ... So we have a default route. ... Maybe what is happening is that because of the way routing is setup the ... DHCP client failed to configure interface WE1 ... INTERnet ACP Created INTERnet interface: ...
    (comp.os.vms)
  • Re: tun0 not responding to ping
    ... IP as the address of its public interface (192.168.0.2 in this ... This causes FreeBSD to have routing problems, ... default route. ... vpnc does seem to be establishing the VPN ...
    (freebsd-net)
  • Re: Cant send packets via WiFi (possibly route issue)
    ... I think that this WiFi device should route all ... it should *all* be routed to the eth1 interface. ... Wireless is much like a point-to-point link using ... The connection between the two networks is the "Wifi AP". ...
    (comp.os.linux.networking)
  • Re: Generate traffic with only one machine - whats wrong with this routing?
    ... external interface even if the IP address is assigned to interface ... ip route del local 10.0.1.11 table local ... seems like an sytax error in the routing tables. ... the packets are sent out on the other interface eth2 as the "From ...
    (comp.os.linux.networking)
  • Re: tun0 not responding to ping
    ... IP as the address of its public interface (192.168.0.2 in this ... This causes FreeBSD to have routing problems, ... default route. ... vpnc does seem to be establishing the VPN ...
    (freebsd-net)