Policy Based Routing not working - am I missing something?

2 posts / 0 new
Last post
MikeRuiz
MikeRuiz's picture
Policy Based Routing not working - am I missing something?

Greetings all,

   Loving my R7000 units still.  DD-WRT provides a lot of potential on them.  I'm trying to get PBR working to do some source based routing.  I've got a vpnc tunnel built as (tun0) which works fine if i use it as my default route, equally I can change my default route back to my normal WAN gateway and that works fine too.  I have two networks LAN side (192.168.0.0/24 normal LAN vlan) and (192.168.86.0/24 on br 1 and a VAP as wl1.1).    Ideally I want my 192.168.0.0/24 network to use the tun0 interface and wl.1.1/br1 192.168.86.0/24 to use normal wlan gw.  Hence Policy source based routing right...

 

    I can do a 'ip route list table local' and 'ip route list table main' and get my routing tables fine.  My issue lies in that i cannot seem to make additional routing tables.  I've tried 'ip rule add from 192.168.86.0/24 table 100' 'ip route add default via x.x.x.x dev vlan2 table 100' 'ip route flush cache'  Not only does it still route out tun0 but if i do any of the list / show commands this new table doesn't show.  so 'ip route list table table 200' and 'ip rule show' do nothing

 

   I've tried the latest build v3.0-r27365M and also v24spw kongac 26365M.

 

Advice and suggestions welcome.  

 

Mike

david.woodward
david.woodward's picture
I'm trying to do something

I'm trying to do something similar except I only want certain traffic from an IP adress (not all from this IP address) to go through the VPN.  However, as part of my troubleshooting I was able to do pretty much what you're trying to do with EVERYTHING from a certain IP going over the VPN and that worked fine.  So, I'm wondering if it isn't as simple as one of your commands being off.

ip route add default via x.x.x.x dev vlan2 table 100

Assuming I'm understanding your setup correctly, shouldn't the device for the gateway on table 100 be "tun0" (not "vlan2")?

ip route add default via x.x.x.x dev tun0 table 100