multiple internet connections iproute2 UDP problems
I've got two internet connections at work.
I want to set it up so that services such as OpenVPN work from either internet connections. I've got it working for SSH, Apache etc.. anything that runs over TCP seems to be fine however UDP doesnt appear to work with the secondary internet connection.
For example I tried to get OpenVPN working it wont work unless in the openvpn configuration I change it to TCP. tcpdump shows the UDP packets making it on secondary interface:
tcpdump -i eth1
15:06:23.347614 IP myhomeip.1764 > MySecondaryWanGateway.1194: UDP, length 14
Here is my current routing script (I've substituted my actual IP's)
#!/bin/sh
IF1=eth0
IP1=MyPrimaryWanIP
P1=MyPrimaryWanGateway
P1_NET=MyPrimaryWanNetmask
#Secondary Internet Connection.
IF2=eth1
IP2=MySecondaryWanIP
P2=MySecondaryWanGateway
P2_NET=MySecondaryWanNetmask
#internal network
P0_NET=192.168.1.0/24
IF0=eth3
ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2
ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2
ip route add default via $P1
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2
ip route add $P0_NET dev $IF0 table T1
ip route add $P2_NET dev $IF2 table T1
ip route add 127.0.0.0/8 dev lo table T1
ip route add $P0_NET dev $IF0 table T2
ip route add $P1_NET dev $IF1 table T2
ip route add 127.0.0.0/8 dev lo table T2
#used to route out the Secondary nic with iptables connmark
ip rule add fwmark 0x4 lookup T2
Does anyone have any ideas?
My primary connection is 10meg fibre, the secondary is DSL the fibre connection I use iptables SNAT, on the secondary I dont do any NAT as the DSL router provides NAT everything passes through unhindered by the router to the linux box in a DMZ.
|