Menu

#314 configurable route deletion

open
5
2012-09-20
2012-09-20
An On
No

We need the possibility to exclude routes from deletion:
The script does:
--------------------------
echo "Deleting routing rules previously set by user space processes..."
$IP route show | grep -v 'proto kernel' | \ while read route ; do $IP route del $route ; done
-------------------------
We need not only "proto kernel" but "dev tun" routes to be excluded. e.g:
------------------------------------------------
$IP route show | egrep -v 'proto kernel|dev tun' | \ while read route ; do $IP route del $route ;
-------------------------------------

background is:
we have routes on "tun" interfaces, created by openvpn that get deleted.
we have a workaround for that by adding the routes manually in fwbuilder.
that works as long as the openvpn client can reach the server and assign an address to the "tun" interface.

the problem is the following sequence:
- openvpn fails to connect to the server
-> no ip address get's assigned to the "tun" interface.
-> "ip route add" fails, because there is no ip
-> route_command_error() rolls back everything

max

Discussion


Log in to post a comment.