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

Re: CONFIG_IP_ROUTE_FWMARK not working in Debian !



supermega napisał(a):
Thank you both.

Nelson Castillo, can you tell me what kernel you're using?

I ain't no Nelson Castillo, but I'm using stock debian kernels.

So..
- I download sarge/stable, install minimal system
- apt-get iproute
- do the following commands:
____________________________
#adding new routing table
echo "200 isp2" >> /etc/iproute2/rt_tables

# setting up routing tables
ip route add default via <PUB_GW_ISP1> dev eth1
ip route add default via <PUB_GW_ISP2> dev eth2 table isp2

# routing marked packets via table isp2
ip rule add fwmark 5 table isp2

# enable forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward

# nat
iptables -t nat -A POSTROUTING -o eth1 -s <LAN_NET> -j SNAT
<PUB_IP_ISP1>
iptables -t nat -A POSTROUTING -o eth2 -s <LAN_NET> -j SNAT
<PUB_IP_ISP2>

# marking packets from LAN_IP
iptables -t mangle -A PREROUTING -s <LAN_IP> -j MARK --set-mark 5
_______________________________________________________

and it should work ?

Yep, it should.



Reply to: