Zxurian 3 Posted ... I'm running Ubuntu, and I'm trying to create some alternate routing rules via iptables for traffic shaping. (some traffic to vpn, some traffic out regular gateway). I've know that I have to use the "route-noexec" directive with the OpenVPN conf, however I seem to be missing something. With the default configuration file downloaded from AirVPN, the following routing rules are added upon a VPN connection. May 20 20:44:08 xbmc ovpn-airvpn[1149]: /sbin/ip addr add dev tun0 local 10.4.11.130 peer 10.4.11.129 May 20 20:44:08 xbmc ovpn-airvpn[1149]: /home/xbmc/.config/openvpn/up.sh tun0 1500 1558 10.4.11.130 10.4.11.129 init May 20 20:44:08 xbmc ovpn-airvpn[1149]: /sbin/ip route add 198.144.158.11/32 via 192.168.199.1 May 20 20:44:08 xbmc ovpn-airvpn[1149]: /sbin/ip route add 0.0.0.0/1 via 10.4.11.129 May 20 20:44:08 xbmc ovpn-airvpn[1149]: /sbin/ip route add 128.0.0.0/1 via 10.4.11.129 May 20 20:44:08 xbmc ovpn-airvpn[1149]: /sbin/ip route add 10.4.0.1/32 via 10.4.11.129 May 20 20:44:08 xbmc ovpn-airvpn[1149]: Initialization Sequence Completed Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 10.4.11.129 128.0.0.0 UG 0 0 0 tun00.0.0.0 192.168.199.1 0.0.0.0 UG 0 0 0 eth010.4.0.1 10.4.11.129 255.255.255.255 UGH 0 0 0 tun010.4.11.129 0.0.0.0 255.255.255.255 UH 0 0 0 tun0128.0.0.0 10.4.11.129 128.0.0.0 UG 0 0 0 tun0192.168.199.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0198.144.158.11 192.168.199.1 255.255.255.255 UGH 0 0 0 eth0 Now with the "route-noexec" directive, the IP's are passed from OpenVPN into the route-up script file, which I can then add my own routes, and if I wanted to duplicate the default routes, would be the following #!/bin/sh /sbin/ip route add 0.0.0.0/1 via $5 /sbin/ip route add 128.0.0.0/1 via $5 /sbin/ip route add 10.4.0.1/32 via $5 However if I run "route-noexec" with that script file, I'm unable to do any dns lookups. I'm assuming it's because I'm missing the following rule from the original connection /sbin/ip route add 198.144.158.11/32 via 192.168.199.1 If I want to setup the VPN, but only direct traffic on a certain port towards the VPN's gateway, do I need that extra IP address, and if so, where do I get it from? Quote Share this post Link to post