Better yet (and this took some source code tweaks in Tomato) if I set the appropriate config option, I can route all traffic down the tunnel, from all the VLANs.
But what if I would like all traffic from one VLAN to go down the tunnel, traffic from another not? Doesn't sound too hard, but so far a solution has eluded me.
I have tried NOT setting the "redirect all" option, and manually routing traffic from a particular VLAN to the tunnel, AND I have tried setting hte "route all" option, and routing traffic from a partuclar VLAN direct to the internet. No yok. My attempts result in a VLAN that no longer seems to even be able to get an IP address via DHCP, never mind connect to the tunnel/internet.
This is an example of what I have tried:
Code: Select all
ip route add 192.168.30.0/24 dev vlan2 table 1
ip route add default via 192.168.254.33 table 1
ip rule add from 192.168.30.0/24 table 1
ip route flush cache
This is the routing table:
Code: Select all
10.255.0.1 * 255.255.255.255 UH 0 0 0 tun11
192.168.254.33 192.168.254.33 255.255.255.255 UGH 0 0 0 vlan2
192.168.254.33 * 255.255.255.255 UH 0 0 0 vlan2
192.168.254.32 * 255.255.255.224 U 0 0 0 vlan2
192.168.30.0 * 255.255.255.0 U 0 0 0 br3
192.168.20.0 * 255.255.255.0 U 0 0 0 br2
192.168.2.0 * 255.255.255.0 U 0 0 0 br0
192.168.8.0 * 255.255.255.0 U 0 0 0 br1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 10.255.0.1 128.0.0.0 UG 0 0 0 tun11
128.0.0.0 10.255.0.1 128.0.0.0 UG 0 0 0 tun11
default 192.168.254.33 0.0.0.0 UG 0 0 0 vlan2
Steve