Skip to contentSkip to conversation

Routing via multiple active PPP devices

DISCUSSION Andre Bender 2 participants 2 messages Mar 6, 2006 – Mar 7, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

for a mobile application we are using multiple internet connections (mostly ppp) to achive a high aviability. Normaly there are at least two open connections (e.g. eth0 and ppp0). Assuming the default route is set correct for use with eth0.

The software I'm writing is opening various sockets and binding them to the devices. Sending via eth0 is working flawlesly but sending via ppp0 does not send at all.

Setup:
eth0 Link encap:Ethernet HWaddr 00:D0:93:07:D5:BE

          inet addr:192.168.255.157  Bcast:192.168.255.255  	
		Mask:255.255.252.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

ppp0 Link encap:Point-Point Protocol

          inet addr:80.187.43.97  P-t-P:192.168.202.1
		Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
Destination     Gateway         Genmask         Flags Iface
192.168.202.1   *               255.255.255.255 UH    ppp0
192.168.252.0   *               255.255.252.0   U     eth0
default         192.168.252.1   0.0.0.0         UG    eth0

My Question is: How do to setup route/iptables so a packet sent via a socket bound to eth0 is sent via eth0 and a packet sent on ppp0 is sent there? I guess it has something to do with source routing but I couldn't figure out from the examples found on the net.

TIA
Andre

#1 lore raw

Andre Bender zei:

Quoted 10 lines

Hi,

for a mobile application we are using multiple internet connections (mostly ppp) to achive a high aviability. Normaly there are at least two
open connections (e.g. eth0 and ppp0). Assuming the default route is
set correct for use with eth0.

The software I'm writing is opening various sockets and binding them to the devices. Sending via eth0 is working flawlesly but sending via ppp0 does not send at all.

....

Quoted 5 lines

My Question is: How do to setup route/iptables so a packet sent via a socket bound to eth0 is sent via eth0 and a packet sent on ppp0 is sent there?
I guess it has something to do with source routing but I couldn't figure
out from the examples found on the net.

I wasn't aware that one could bind a socket to an interface. I think you mean that you bind the socket to the same address as the interface is bound to.

Sending packets works as follows:
- A local address is assigned if one wasn't assigned yet (in your case you did assign an address)
- The packet is routed based on the destination address and the routing table.

So sending to 192.168.202.1/32 will use ppp0, all other packets will use eth0.

More importantly, what do you want to achieve? It's not completely clear from your description.

HTH,
M4