Hi guy, here it is a good problem, a lot of time discussed here but
without a good solution, that I found for ASL V.4.
Now I'm using:
ASL 5.100 with full service (IP,SF,etc..)
4 nic: 1 internal, 1 dmz and two nic external (2 connection to xDSL:
xDSLA and xDSLB with two router)
I could use with ASL V.4 source ip route policy without problem, sò a
branch of my lan could use xDSL A and the other xDSL B.
My problem with ASL5.100 is that every x minutes (x very low, only two or
three minutes) checking mangle table I can see that my script settings are lost.
I can not understand which service is doing sò and how can I avoid this.
Anyone can help me ???
--------------------------------------------------------------------------------
Here it is my script:
Normally default route is 192.168.100.1, adding a new table (200) and marking
packet for using that ip route policy table, where default route is 192.168.101.1
--------------------------------------------------------------------------------
fw5:/etc/init.d # cat /var/mdw/scripts/routes_personalized.sh
/sbin/ip rule del fwmark 2 table 200
/sbin/ip route del default via 192.168.101.1 dev eth0 table 200
/usr/sbin/iptables -D PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -D PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -D PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -D PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -A PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -A PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -A PREROUTING -t mangle -s -j MARK --set-mark 2
/usr/sbin/iptables -A PREROUTING -t mangle -s -j MARK --set-mark 2
/sbin/ip rule add fwmark 2 table 200
/sbin/ip route add default via 192.168.101.1 dev eth0 table 200
/sbin/ip route add router1network dev eth1 scope link table 200
/sbin/ip route add router2network dev eth0 scope link table 200
/sbin/ip route add dmznetwork dev eth2 scope link table 200
/sbin/ip route add lan-network dev eth3 scope link table 200
/sbin/ip route add 127.0.0.0/8 dev lo scope link table 200
/sbin/ip route flush cache
--------------------------------------------------------------------------------
Before running this script I check tha mangle table:
--------------------------------------------------------------------------------
fw5:/etc/init.d # iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere state RELATED helper match "ftp" LOG level info prefix `FTP_DATA: '
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
SET_PRIO_HIGH tcp -- anywhere anywhere tcp flags:ACK/ACK length 50:100
SET_PRIO_HIGH all -- anywhere anywhere TOS match Minimize-Delay
SET_PRIO_HIGH icmp -- anywhere anywhere
Chain SET_PRIO_HIGH (3 references)
target prot opt source destination
CLASSIFY all -- anywhere anywhere CLASSIFY set 0:8
ACCEPT all -- anywhere anywhere
Chain SET_PRIO_LOW (0 references)
target prot opt source destination
CLASSIFY all -- anywhere anywhere CLASSIFY set 0:5
ACCEPT all -- anywher anywhere
--------------------------------------------------------------------------------
Then run the script:
--------------------------------------------------------------------------------
fw5:/etc/init.d # /var/mdw/scripts/routes_personalized.sh
--------------------------------------------------------------------------------
Check tha mangle table: now I can see my p.r.
--------------------------------------------------------------------------------
fw5:/etc/init.d # iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere state RELATED helper match "ftp" LOG level info prefix `FTP_DATA: '
MARK all -- anywhere MARK set 0x2
MARK all -- anywhere MARK set 0x2
MARK all -- anywhere MARK set 0x2
MARK all -- anywhere MARK set 0x2
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
SET_PRIO_HIGH tcp -- anywhere anywhere tcp flags:ACK/ACK length 50:100
SET_PRIO_HIGH all -- anywhere anywhere TOS match Minimize-Delay
SET_PRIO_HIGH icmp -- anywhere anywhere
Chain SET_PRIO_HIGH (3 references)
target prot opt source destination
CLASSIFY all -- anywhere anywhere CLASSIFY set 0:8
ACCEPT all -- anywhere anywhere
Chain SET_PRIO_LOW (0 references)
target prot opt source destination
CLASSIFY all -- anywhere anywhere CLASSIFY set 0:5
ACCEPT all -- anywhere anywhere
--------------------------------------------------------------------------------
Wait for some minutes (about 2-5) and check againg mangle table:
--------------------------------------------------------------------------------
fw5:/etc/init.d # iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere state RELATED helper match "ftp" LOG level info prefix `FTP_DATA: '
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
SET_PRIO_HIGH tcp -- anywhere anywhere tcp flags:ACK/ACK length 50:100
SET_PRIO_HIGH all -- anywhere anywhere TOS match Minimize-Delay
SET_PRIO_HIGH icmp -- anywhere anywhere
Chain SET_PRIO_HIGH (3 references)
target prot opt source destination
CLASSIFY all -- anywhere anywhere CLASSIFY set 0:8
ACCEPT all -- anywhere anywhere
Chain SET_PRIO_LOW (0 references)
target prot opt source destination
CLASSIFY all -- anywhere anywhere CLASSIFY set 0:5
ACCEPT all -- anywhere anywhere
--------------------------------------------------------------------------------
Arrrrrrgggg: As you can see.....All my settings are lost!
Thanks for every suggestion...
Anty
This thread was automatically locked due to age.