nano-setup with fixed routes.

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I have a linux-box connected to an internal LAN and two
ADSL-connections. I am using the nano.txt setup with patches applied,
and everything is working fine.

My problem is that I want to route traffic to some specific hosts (DNS
and mail-servers) to a specific ADSL-line.

I have tried to add the following

ip route add 195.82.195.0/24 dev eth0 src 83.72.197.108 proto static
table 222

to the setup. This works for all traffic originating from the LAN, and
for all TCP-traffic originating from the server, but not for UDP or ICMP
from the server. This breaks totally:

ping 195.82.195.104 gives me a "Destination Host Unreachable" from the
server itself.

What should I do?

My full setup (straight from nano.txt) is as follows:

eth0 - line 1
eth1 - line 2
eth3 - internal LAN.
kernel - 2.6.8

# --- routing --------------
ip rule add prio 50 table main
ip route del default table main 2> /dev/null > /dev/null
                                                                                ip rule add prio 201 from 83.72.192.0/19 table 201
ip route add default via 83.72.192.1 dev eth0 src 83.72.197.108 proto
static table 201
ip route append prohibit default table 201 metric 1 proto static
 
ip rule add prio 202 from 10.2.0.0/24 table 202
ip route add default via 10.2.0.1 dev eth1 src 10.2.0.2 proto static
table 202
ip route append prohibit default table 202 metric 1 proto static
 
ip rule add prio 222 table 222
ip route add default table 222 proto static \
        nexthop via 83.72.192.1 dev eth0 weight 1\
        nexthop via 10.2.0.1 dev eth1 weight 1
                                                                                # --- NAT --------------------

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 83.72.197.108
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 10.2.0.2
 



_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux