How to setup Zerotier client mode (just to access router) ?

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


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Wed Nov 28, 2018 2:33    Post subject: How to setup Zerotier client mode (just to access router) ? Reply with quote
I have installed and running Zerotier client on my router.
Router is connecting to my Zerotier network, and is visible as logged into it.
From router's shell I can ping any of other devices connected to Zerotier network, but I cant ping router from other devices.
It looks that all ports of Zerotier IP are closed by default.

On google there is many answers how to bridge zerotier network with real subnet, but I don't want to do that.
I just want to use Zerotier to access my DD-WRT NAS, Media-server and Router WEB-UI.

When installed zerotier client on ubuntu, there was no problem with access, so it must be something that blocks everything but br0 (or something like that).

Here is my ifconfig (I ripped ipv6 lines off - as it doesn't matter) :

Code:

br0       Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B8 
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4357487 errors:0 dropped:143 overruns:0 frame:0
          TX packets:13723587 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:458147706 (436.9 MiB)  TX bytes:19272060753 (17.9 GiB)

br0:0     Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B8 
          inet addr:169.254.255.1  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0      Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B6 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14278551 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6654994 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2291525162 (2.1 GiB)  TX bytes:3700427395 (3.4 GiB)
          Interrupt:4 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B8 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2739805 errors:0 dropped:5 overruns:0 frame:1055656
          TX packets:6326888 errors:290 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:209275774 (199.5 MiB)  TX bytes:189793956 (181.0 MiB)
          Interrupt:3 Base address:0x8000

eth2      Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B5 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:969215 errors:0 dropped:2 overruns:0 frame:6367542
          TX packets:5086362 errors:15 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:203136284 (193.7 MiB)  TX bytes:3133035637 (2.9 GiB)
          Interrupt:5 Base address:0x8000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MULTICAST  MTU:65536  Metric:1
          RX packets:16079 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16079 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2715745 (2.5 MiB)  TX bytes:2715745 (2.5 MiB)

vlan1     Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B6 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:586975 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2411669 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:88483897 (84.3 MiB)  TX bytes:3173361186 (2.9 GiB)

vlan2     Link encap:Ethernet  HWaddr 84:1B:5E:37:FD:B7 
          inet addr:212.222.215.68  Bcast:212.222.223.255  Mask:255.255.224.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13691575 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4243319 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:19068781629 (17.7 GiB)  TX bytes:500445669 (477.2 MiB)

ztklhynlkh Link encap:Ethernet  HWaddr 3E:35:37:51:21:68 
          inet addr:192.168.11.11  Bcast:192.168.11.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:2800  Metric:1
          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:4152 (4.0 KiB)  TX bytes:18993 (18.5 KiB)
Sponsor
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Sat Dec 01, 2018 3:06    Post subject: Reply with quote
Today I installed OpenVPN server and successfully connected 2 clients to it.
Successfully means that devices are getting connected, but unfortunately router is isolated also from OpenVPN.

So basically all router services that are not accessible from WAN, are also blocked for everything but LAN.

So it is dd-wrt issue, not zerotier nor openvpn.

It is completely strange.
I did even try something that works for WAN - port forwarding.
I forwarded all Samba ports from OpenVPN network 10.1.1.0/24 to identical ports of my router LAN IP

For WAN it works (of course I didn't forward samba ports on WAN - its was something else) - for TUN it doesn't.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Sat Dec 01, 2018 15:00    Post subject: Reply with quote
A lot of us are running an Open VPN server on our DDWRT routers and can connect to the router and to the clients on the subnet.
So maybe have a look at your OpenVPN server configuration.
Have you enabled Redirect Default gateway? If not, did you push a route to the clients?
Assuming you have a TUN setup are server and clients (and VPN subnet) different?
Did you test from outside i.e. via cellular?

_________________
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
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Sun Dec 02, 2018 2:05    Post subject: Reply with quote
I restored old router settings and cancelled everything.

I need just simple access to my files, so I will just set SFPT to be accessible from outside.
If I will use secure key authentication - should be safe, and I'm sure it will work as I need.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Dec 02, 2018 4:52    Post subject: Reply with quote
There shouldn't be any NAT from the OpenVPN client's network to the LAN, so not port forwarding is applicable.

Use SSH keys and turn off password authentication.
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Sun Dec 02, 2018 14:08    Post subject: Reply with quote
Heh, I'm playing with linux since 2000, since 2010 its my main OS, but DD-WRT is so cropped even in giga build, that everything is difficult to get:

1. Zerotier - isolated and cant access router services.
2. OpenVPN - the same - maybe using TAP instead of TUN would help, but TAP is unsafe.
3. SoftEther - works great!, however Android Client need to run on rooted device - and I don't want to root my phone, as its unsafe, and some banking software may deny to run on rooted device.
4 SFTP - service ripped off from SSH service - so to get SFTP work, you have to switch built in SSH off and than install Optware version, but configuring it is pain in ...

Generally I'm disappointed with dd-wrt.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Sun Dec 02, 2018 14:43    Post subject: Reply with quote
DDWRT is light weight so it is stripped, but on an powerfull router you can load all kind of additional packages.
That said OpenVPN works right out of the box, I (among thousands of others) are using an OpenVPN server (TUN setup as indeed TAP is not that safe) which is working great with all sorts of clients e.g. Windows, Apple, Android and other DDWRT routers as clients.

Attached my notes for setting up an OpenVPN server on a DDWRT router and for setting up different sort of clients

Mind you OpenVPN is resource intensive you need a modern router with a recent build, I am using a Netgear R6400v2 with the latest Kong build at the moment for my VPN server and throughput is around 50 Mb/s on VPN
If you need more, than you have to invest in a more powerfull router (like a Netgear R7800)

_________________
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


Last edited by egc on Sun Dec 02, 2018 14:44; edited 1 time in total
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Dec 02, 2018 14:43    Post subject: Reply with quote
You don't mention what router model and build you are using.

I can SFTP into my R7800 with Kong build R37845M. Routers with smaller flash space may have some functions removed.

The username is "root" and the same password as for the GUI.
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Mon Dec 03, 2018 13:08    Post subject: Reply with quote
I'm using Netgear WNDR4500v1 and giga build (R37860).

Yesterday I spent some time on #debian irc channel, and some people helped me to discover the problem.

Basically Zerotier/OpenVPN network interface is treated as WAN, not LAN - so its behind SPI firewall, wchich blocks everything even if I add rules to IPTables, SPI will treat all connections as threat/danger.
So basically I need to set rules for IPTables, and somehow make SPI to switch filtering off for packets coming from VPN. Somehow is the key word, as I don't know how.
Or maybe there is another way ?

BTW. Dont know why VPN became synonym of anonymous networking, or networkingh with fake location.
This may by nice feature, but we shouldn't forget that VPN is for Virtual Private Network - Not Virtual Global Network or something. So it shouldn't me treated as WAN.
I don't know if there is any feature request forum, but I wish to see zerotier built into the firmware as an option - witch all settings to do (firewall it or not etc.)
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Mon Dec 03, 2018 13:15    Post subject: Reply with quote
Per Yngve Berg wrote:
You don't mention what router model and build you are using.

I can SFTP into my R7800 with Kong build R37845M. Routers with smaller flash space may have some functions removed.

The username is "root" and the same password as for the GUI.


I did test and yes, I can SFTP to router now when I'm using password - but with key authentication, I had problem with this. Error messages that I got suggested me that sshd is missing of sftp module, and only way to get it would be to swich built in sshd off, and install entware one.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Mon Dec 03, 2018 13:15    Post subject: Reply with quote
Luckily the VPN interface is treated as a WAN interface, a lot of VPN providers do not use any firewall at all, so if the interface was not treated as a WAN interface you would be totally exposed.
Now you can at least switch the firewall on or off (via a setting in the GUI although there is a bug and the firewall is not working as intended, but that is another story)

_________________
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
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Mon Dec 03, 2018 14:38    Post subject: Reply with quote
I don't agree that its good.
I don't want to switch SPI for my Internet connection, I want to switch it off only for VPN.
If I would use proxy VPN I would agree that in that case it would be usefull, but otherwise - when I'm using VPN as small LAN for personal use - I don't want to filter anything in that network.

But, If I already know what exactly the problem is, can someone help me to set the things up? how to switch SPI off only for VPN or at least how to redirect packets to be seen by router as coming from LAN network (I guess this may be complicated).
Thanks Smile
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Mon Dec 03, 2018 14:59    Post subject: Reply with quote
The VPN is your connection to the internet (at least in a lot of use cases where you use your VPN client to route to a commercial VPN provider to get to the internet).
Therefore a firewall is not a bad idea.

You can switch the VPN Client's firewall off in the VPN GUI (enable Advanced Options) (actually, I think, it is always off in a lot of builds due to a bug).

The Firewall for the WAN interface will stay on off course.

Furthermore depending on your setup you can disable NAT and that is maybe what you are referring to when you talk about coming from LAN.

I do not know anything about zerotier, but I do know a little about OpenVPN client, OpenVPN server, firewall and routing 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
amikot
DD-WRT Novice


Joined: 30 Sep 2018
Posts: 47
Location: United Kingdom

PostPosted: Mon Dec 03, 2018 17:37    Post subject: Reply with quote
I don't need to route to internet through VPN.

Zerotier is simple in set up - you install on anything you want to have in your virtual LAN and you join them to network that you managing on your zerotier account.
Basically its like chat group where users are devices and chatroom is network.

Normally LAN is limited to your location, but with zerotier works anywhere on almost any device.
That's the idea.

So there is no routing internet trough zerotier network.

There is no danger, but it is still blocked.
And I cant switch filtering off just for zerotier, because its optware - not managed in GUI.
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