[SOLVED] Questions about always on VPN client

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
tpqnew
DD-WRT Novice


Joined: 03 Dec 2020
Posts: 47

PostPosted: Fri Dec 08, 2023 12:24    Post subject: [SOLVED] Questions about always on VPN client Reply with quote
Hi,
I'm using dd-wrt 54420.

If I set a wireguard VPN client does checking the 'kill switch' enough to prevent any connections outside the vpn tunnel or are some firewall rules needed?

What about openVPN? I haven't seen any kill switch option there.

(My goal is to prevent any device connected to the router to leak my ISP IP, if the VPN is down not to fallback to my ISP connection.)

My old VPN provider on an old DD-WRT version said to add the following as a startup script:
route add -host WG_HOSTNAME gw DEF_GW dev DEF_IFACE
route del default
route add default dev oet1
iptables -t nat -I POSTROUTING -o oet1 -j MASQUERADE
iptables -I FORWARD -i br0 -o DEF_IFACE -m state --state NEW -j REJECT --reject-with icmp-host-prohibited
iptables -I FORWARD -i br0 -p tcp -o DEF_IFACE -m state --state NEW -j REJECT --reject-with tcp-reset

Is it needed?

Thank you
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Fri Dec 08, 2023 13:15    Post subject: Re: Questions about always on VPN client Reply with quote
tpqnew wrote:
Hi,
If I set a wireguard VPN client does checking the 'kill switch' enough to prevent any connections outside the vpn tunnel or are some firewall rules needed?


Why not consult the manual page 12?


tpqnew wrote:

What about openVPN? I haven't seen any kill switch option there.


Perhaps look better Wink
and yes consult the manual page 5

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
tpqnew
DD-WRT Novice


Joined: 03 Dec 2020
Posts: 47

PostPosted: Fri Dec 08, 2023 15:44    Post subject: Reply with quote
In my (very weak) defense... the guide version I was working with was older and only had 10 pages Smile
Downloaded the new one.

As always, thank you for your help!
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Fri Dec 08, 2023 16:03    Post subject: Reply with quote
Glad you solved it and if you have any other questions feel free to ask, we are here to help Smile
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
tpqnew
DD-WRT Novice


Joined: 03 Dec 2020
Posts: 47

PostPosted: Tue Dec 12, 2023 16:45    Post subject: Reply with quote
turns out my very old ddwrt version does not have the kill switch option for the openVPN.
Would the following firewall rule be enough as a kill switch alternative:
iptables -I forward -i br0 -o `nvram get wan_iface` -J REJECT

Thanks
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Tue Dec 12, 2023 17:28    Post subject: Reply with quote
Old version has security issues so better upgrade

Code:
iptables -I FORWARD -i br0 -o $(get_wanface) -j REJECT

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
tpqnew
DD-WRT Novice


Joined: 03 Dec 2020
Posts: 47

PostPosted: Tue Dec 12, 2023 17:43    Post subject: Reply with quote
Thank you.

Old router. all my upgrade attempts failed (had a thread about it)
tpqnew
DD-WRT Novice


Joined: 03 Dec 2020
Posts: 47

PostPosted: Tue Dec 12, 2023 17:48    Post subject: Reply with quote
sorry, just checked and get_wanface returns 'vlan' while nvram get wan_iface returns 'vlan2'.
If I check ip route , default route is named vlan2.
which one is correct?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Tue Dec 12, 2023 17:54    Post subject: Reply with quote
Cannot tell the rule I gave is for modern builds.

That is why we do no longer support old versions Sad

Just try and check if the killswitch is really working.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1959

PostPosted: Tue Dec 12, 2023 18:54    Post subject: Reply with quote
tpqnew wrote:
Thank you.

Old router. all my upgrade attempts failed (had a thread about it)

Your post in the thread "Can I connect a router to a proxy server on my lan?" and the thread "Unable to upgrade tplink 1043 to a newer version" is what you are referring to, correct?

Download https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2023/12-07-2023-r54475/tplink_tl-wr1043nd/tl-wr1043nd-webflash.bin
Enable ssh (which enables scp) and use WinSCP or similar method to transfer the file to /tmp on your router and issue a 'write tl-wr1043nd-webflash.bin linux' (from /tmp dir) and after that finishes, issue 'reboot'. There is NO reason for the upgrade to fail, as reiterated more than once in the second thread. I have a v1.8 that is on the current release and have had zero issues upgrading DD-WRT. There is something more to this picture than you are sharing.

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
tpqnew
DD-WRT Novice


Joined: 03 Dec 2020
Posts: 47

PostPosted: Tue Dec 12, 2023 19:46    Post subject: Reply with quote
I've tried that multiple times, it says upgrade successful, but after reboot it stays on the same old version.
I've bricked my other tp-link 1043 v2 a week ago... its last words were 'update successful'. tried all the resets and tftp methods i could find, but nothing worked.

so, maybe there is NO reason for the upgrade to fail... but it still does sometimes Smile

until I'll get a newer router, this one will have to do I guess.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1959

PostPosted: Tue Dec 12, 2023 21:20    Post subject: Reply with quote
Tangent reply regarding upgrade issue continued in "Unable to upgrade tplink 1043 to a newer version" so as not to further litter this thread with off-topic discussion.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum