DrLove73
11-12-2007, 09:40 AM
I am trying to find a way to incorporate policy routing with either static or OLSR routing (I never done OLSR before).
I tested policy routing, and found some features that make my life hell.
I you want to insert policy routing for all traffic of one or more IP's, or for entire subnet, before static routes, You have to writes ALL the routes (already in static routes), or that IP/subnet from that point on will not be able to see any other IP/subnet that is not on the default route written in policy routing script.
Example:
eth0:
inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
inet 192.168.110.200/24 brd 192.168.110.255 scope global eth0
wpci0:
inet 192.168.212.100/24 brd 192.168.212.255 scope global wpci0
inet 192.168.201.100/24 brd 192.168.201.255 scope global wpci0
wpci1:
inet 192.168.120.100/24 brd 192.168.120.255 scope global wpci1
wpci2:
inet 172.25.14.100/24 brd 172.25.14.255 scope global wpci2
inet 172.25.15.100/24 brd 172.25.15.255 scope global wpci2
inet 172.25.200.100/24 brd 172.25.200.255 scope global wpci2
wpci3:
inet 172.25.10.100/24 brd 172.25.10.255 scope global wpci3
STATIC ROUTES:
192.168.240.0/24 via 172.25.200.200 dev wpci2
192.168.131.0/24 via 192.168.120.200 dev wpci1
192.168.130.0/24 via 192.168.120.200 dev wpci1
192.168.211.0/24 via 172.25.10.200 dev wpci3
192.168.210.0/24 via 172.25.10.200 dev wpci3
192.168.119.0/24 via 172.25.14.200 dev wpci2
192.168.215.0/24 via 172.25.15.200 dev wpci2
192.168.32.0/24 via 192.168.120.200 dev wpci1
192.168.230.0/24 via 192.168.120.200 dev wpci1
192.168.214.0/24 via 172.25.14.200 dev wpci2
192.168.132.0/24 via 192.168.120.200 dev wpci1
192.168.231.0/24 via 192.168.120.200 dev wpci1
192.168.31.0/24 via 192.168.120.200 dev wpci1
192.168.232.0/24 via 192.168.120.200 dev wpci1
192.168.200.0/24 via 172.25.200.200 dev wpci2
192.168.233.0/24 via 192.168.120.200 dev wpci1
192.168.219.0/24 via 172.25.14.200 dev wpci2
192.168.234.0/24 via 192.168.120.200 dev wpci1
192.168.250.0/24 via 192.168.120.200 dev wpci1
192.168.220.0/24 via 192.168.120.200 dev wpci1
192.168.235.0/24 via 192.168.120.200 dev wpci1
DIRECT ROUTES (IP's ARE ON THIS UNIT)
192.168.110.0/24 dev eth0 proto kernel scope link src 192.168.110.200
192.168.120.0/24 dev wpci1 proto kernel scope link src 192.168.120.100
192.168.201.0/24 dev wpci0 proto kernel scope link src 192.168.201.100
172.25.200.0/24 dev wpci2 proto kernel scope link src 172.25.200.100
172.25.14.0/24 dev wpci2 proto kernel scope link src 172.25.14.100
172.25.15.0/24 dev wpci2 proto kernel scope link src 172.25.15.100
192.168.212.0/24 dev wpci0 proto kernel scope link src 192.168.212.100
172.25.10.0/24 dev wpci3 proto kernel scope link src 172.25.10.100
192.168.114.0/24 dev wpci2 proto kernel scope link src 192.168.114.100
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.2
DEFAULT STATIC ROUTE:
default via 192.168.110.100 dev eth0
When I wanted to redirect all traffic to another edge router, on other link (from this unit), by policy routing, I had to enter ALL subnets that this unit knows of in bypass rules in "policy and advanced routing" script :
policy from 192.168.0.0/16 {
# Chiron
net 192.168.110.0/24 via 192.168.110.100
# Panline
net 82.208.0.0/16 via 192.168.110.100
net 10.0.0.0/0 via 192.168.110.100
# Turija
net 172.25.10.0/24 via 172.25.10.200
net 192.168.210.0/24 via 172.25.10.200
net 192.168.211.0/24 via 172.25.10.200
# Centar
net 172.25.15.0/24 via 172.25.15.200
net 192.168.215.0/24 via 172.25.15.200
# Radio
net 172.25.14.0/24 via 172.25.14.200
net 192.168.214.0/24 via 172.25.14.200
# Vrbas
net 192.168.120.0/24 via 192.168.120.200
net 192.168.31.0/24 via 192.168.120.200
net 192.168.32.0/24 via 192.168.120.200
net 192.168.230.0/24 via 192.168.120.200
net 192.168.231.0/24 via 192.168.120.200
net 192.168.232.0/24 via 192.168.120.200
net 192.168.233.0/24 via 192.168.120.200
net 192.168.234.0/24 via 192.168.120.200
net 192.168.235.0/24 via 192.168.120.200
net 192.168.236.0/24 via 192.168.120.200
# Kucura
net 192.168.130.0/24 via 192.168.120.200
net 192.168.220.0/24 via 192.168.120.200
default 172.25.200.200 }
Not even directly connected subnets where accessible if they weren't added as a exclusion from policy routing.
Is there any other resolution other then entering heap of rules for every single subnet/IP I need custom rules for?
And what is situation with OLSR? can they help avoiding redundant writing?
It would be best if policy routing script could (in one option) just replace default route for desired subnet/IP entered in policy routing script.
I tested policy routing, and found some features that make my life hell.
I you want to insert policy routing for all traffic of one or more IP's, or for entire subnet, before static routes, You have to writes ALL the routes (already in static routes), or that IP/subnet from that point on will not be able to see any other IP/subnet that is not on the default route written in policy routing script.
Example:
eth0:
inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
inet 192.168.110.200/24 brd 192.168.110.255 scope global eth0
wpci0:
inet 192.168.212.100/24 brd 192.168.212.255 scope global wpci0
inet 192.168.201.100/24 brd 192.168.201.255 scope global wpci0
wpci1:
inet 192.168.120.100/24 brd 192.168.120.255 scope global wpci1
wpci2:
inet 172.25.14.100/24 brd 172.25.14.255 scope global wpci2
inet 172.25.15.100/24 brd 172.25.15.255 scope global wpci2
inet 172.25.200.100/24 brd 172.25.200.255 scope global wpci2
wpci3:
inet 172.25.10.100/24 brd 172.25.10.255 scope global wpci3
STATIC ROUTES:
192.168.240.0/24 via 172.25.200.200 dev wpci2
192.168.131.0/24 via 192.168.120.200 dev wpci1
192.168.130.0/24 via 192.168.120.200 dev wpci1
192.168.211.0/24 via 172.25.10.200 dev wpci3
192.168.210.0/24 via 172.25.10.200 dev wpci3
192.168.119.0/24 via 172.25.14.200 dev wpci2
192.168.215.0/24 via 172.25.15.200 dev wpci2
192.168.32.0/24 via 192.168.120.200 dev wpci1
192.168.230.0/24 via 192.168.120.200 dev wpci1
192.168.214.0/24 via 172.25.14.200 dev wpci2
192.168.132.0/24 via 192.168.120.200 dev wpci1
192.168.231.0/24 via 192.168.120.200 dev wpci1
192.168.31.0/24 via 192.168.120.200 dev wpci1
192.168.232.0/24 via 192.168.120.200 dev wpci1
192.168.200.0/24 via 172.25.200.200 dev wpci2
192.168.233.0/24 via 192.168.120.200 dev wpci1
192.168.219.0/24 via 172.25.14.200 dev wpci2
192.168.234.0/24 via 192.168.120.200 dev wpci1
192.168.250.0/24 via 192.168.120.200 dev wpci1
192.168.220.0/24 via 192.168.120.200 dev wpci1
192.168.235.0/24 via 192.168.120.200 dev wpci1
DIRECT ROUTES (IP's ARE ON THIS UNIT)
192.168.110.0/24 dev eth0 proto kernel scope link src 192.168.110.200
192.168.120.0/24 dev wpci1 proto kernel scope link src 192.168.120.100
192.168.201.0/24 dev wpci0 proto kernel scope link src 192.168.201.100
172.25.200.0/24 dev wpci2 proto kernel scope link src 172.25.200.100
172.25.14.0/24 dev wpci2 proto kernel scope link src 172.25.14.100
172.25.15.0/24 dev wpci2 proto kernel scope link src 172.25.15.100
192.168.212.0/24 dev wpci0 proto kernel scope link src 192.168.212.100
172.25.10.0/24 dev wpci3 proto kernel scope link src 172.25.10.100
192.168.114.0/24 dev wpci2 proto kernel scope link src 192.168.114.100
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.2
DEFAULT STATIC ROUTE:
default via 192.168.110.100 dev eth0
When I wanted to redirect all traffic to another edge router, on other link (from this unit), by policy routing, I had to enter ALL subnets that this unit knows of in bypass rules in "policy and advanced routing" script :
policy from 192.168.0.0/16 {
# Chiron
net 192.168.110.0/24 via 192.168.110.100
# Panline
net 82.208.0.0/16 via 192.168.110.100
net 10.0.0.0/0 via 192.168.110.100
# Turija
net 172.25.10.0/24 via 172.25.10.200
net 192.168.210.0/24 via 172.25.10.200
net 192.168.211.0/24 via 172.25.10.200
# Centar
net 172.25.15.0/24 via 172.25.15.200
net 192.168.215.0/24 via 172.25.15.200
# Radio
net 172.25.14.0/24 via 172.25.14.200
net 192.168.214.0/24 via 172.25.14.200
# Vrbas
net 192.168.120.0/24 via 192.168.120.200
net 192.168.31.0/24 via 192.168.120.200
net 192.168.32.0/24 via 192.168.120.200
net 192.168.230.0/24 via 192.168.120.200
net 192.168.231.0/24 via 192.168.120.200
net 192.168.232.0/24 via 192.168.120.200
net 192.168.233.0/24 via 192.168.120.200
net 192.168.234.0/24 via 192.168.120.200
net 192.168.235.0/24 via 192.168.120.200
net 192.168.236.0/24 via 192.168.120.200
# Kucura
net 192.168.130.0/24 via 192.168.120.200
net 192.168.220.0/24 via 192.168.120.200
default 172.25.200.200 }
Not even directly connected subnets where accessible if they weren't added as a exclusion from policy routing.
Is there any other resolution other then entering heap of rules for every single subnet/IP I need custom rules for?
And what is situation with OLSR? can they help avoiding redundant writing?
It would be best if policy routing script could (in one option) just replace default route for desired subnet/IP entered in policy routing script.