-1

I have some startup and firewall commands that don't seem to be working on my "new" router that worked perfectly on my old one. The startup command should allow me to tunnel into my work network using pretty standard OpenVPN scripts and the firewall is just 4 lines with iptables adjustments.

I flashed the router twice, first with the stock build, DD-WRT v3.0-r40559 std (08/06/19), then after reading that there were possible VPN issues with that one, I re-flashed to DD-WRT v3.0-r41813 std (12/29/19). Everything else works great.

So my new router is on DD-WRT v3.0-r41813 std (12/29/19) and the old one was on DD-WRT v24-sp2 (04/13/11) big.

The start-up code follows (masking IP and static key):
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Move to writable directory and create scripts

cd /tmp
ln -s /usr/sbin/openvpn /tmp/myvpn

Config for Wes-to-Office

echo "
remote XX.XX.XXX.XXX
proto udp
port 4194
dev tun0
secret /tmp/static.key
verb 3
comp-lzo
keepalive 15 60
daemon
" > Wes-Office.conf

Config for Static Key

echo "
-----BEGIN OpenVPN Static key V1-----
xxxxxTHE VERY LONG STATIC KEY IS HEREXXXXX
-----END OpenVPN Static key V1-----
" > static.key

Create interface to ALD

/tmp/myvpn --mktun --dev tun0
ifconfig tun0 xx.xx.xx.x netmask 255.255.255.0 promisc up
route add -net 192.168.XX.0 netmask 255.255.255.0 gw xx.xx.xx.x
route add -net 192.168.XX.0 netmask 255.255.255.0 gw xx.xx.xx.x
route add -net 192.168.XX.0 netmask 255.255.255.0 gw xx.xx.xx.x
route add -net 192.168.XX.0 netmask 255.255.255.0 gw xx.xx.xx.x
route add -net 192.168.XX.0 netmask 255.255.255.0 gw xx.xx.xx.x
route add -net 192.168.XX.0 netmask 255.255.255.0 gw xx.xx.xx.x

Initiate the tunnel

sleep 5
/tmp/myvpn --config Wes-Office.conf
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

The Firewall code follows:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Open firewall holes for VPN

iptables -I INPUT 2 -p udp --dport 4194 -j ACCEPT
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT

Allow ping over VPN

iptables -I INPUT 3 -i tun0 -p icmp -j ACCEPT
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

  • You should edit your question and indicate what commands are. It working. What version of DD-WRT was the other router using? – Ramhound Mar 15 at 19:30
  • @Ramhound I've added the code and other information. Thanks for any feedback you might have. – Wes Mar 15 at 20:49
0

Figured it out!
after adding 'modprobe tun' into the start script, it works. Sometime between builds, it must have been turned off by default.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.