Blocking SSH, VNC, and other services over WAN but not LAN

Page 1 of 2 [ 23 posts ]  Go to page 1, 2  Next

mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

03 Jul 2016, 5:35 am

I have an Actiontec T2200H router from my ISP, and I'd like to be able to block certain types of connections over WAN, while still allowing them on local IP addresses. Specifically, I want to be able to SSH or VNC into my desktop from another computer on my network, but I don't want the SSH or VNC server to be available over the Internet. How would I accomplish this? Do I need to set up my own router?


_________________
Every day is exactly the same...


Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 57
Gender: Female
Posts: 2,820
Location: S.F Bay Area

03 Jul 2016, 4:42 pm

Most home routers like the T2200H only have a firewall / packet filtering / port blocking between the WAN and the LAN. On the LAN (ie, 192.168.1.xxx) side, your only restriction is likely to be the Windows firewall (or other software firewall), if applicable.


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

03 Jul 2016, 11:24 pm

Edenthiel wrote:
Most home routers like the T2200H only have a firewall / packet filtering / port blocking between the WAN and the LAN. On the LAN (ie, 192.168.1.xxx) side, your only restriction is likely to be the Windows firewall (or other software firewall), if applicable.

I should have clarified, I'm running Manjaro Linux on my desktop and my laptop. I was just thinking though, what if I decide to create my own router, or at least buy one that supports DD-WRT? What would be the most optimal way to set this up for speed and security?

Thinking about this now, a router-based solution would be best, since I do run Windows 7 on my desktop sometimes. I used to use RDP to log into my desktop remotely, but unfortunately I don't know how I'd set that up in such a way that it only works on my local subnet. Also, I want to switch to using VNC since it is platform agnostic.


_________________
Every day is exactly the same...


Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 57
Gender: Female
Posts: 2,820
Location: S.F Bay Area

04 Jul 2016, 6:22 pm

So, if I may clarify - all of this traffic will be on your local side of the firewall, correct? As in, from one 192.168.1.x address to another? If so, your current router from your ISP will not restrict it.

If you mean connecting to a local 192.168.1.x address from somewhere via the Internet, your router's firewall will need to have ports &/or protocols opened to allow that specific type of traffic in order to connect to the local machine.


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

04 Jul 2016, 8:33 pm

Edenthiel wrote:
So, if I may clarify - all of this traffic will be on your local side of the firewall, correct? As in, from one 192.168.1.x address to another? If so, your current router from your ISP will not restrict it.

If you mean connecting to a local 192.168.1.x address from somewhere via the Internet, your router's firewall will need to have ports &/or protocols opened to allow that specific type of traffic in order to connect to the local machine.

I only want these ports to be accessible from my side of the network, and I don't want these ports to be accessible from remote addresses. Since you mentioned that I would have to forward the ports in question to allow remote access, does this mean that my current setup is fine as-is? When I run a GRC ShieldsUp port scan using the "all service ports" option, it passes with flying colors, with all ports stealthed.


_________________
Every day is exactly the same...


Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 57
Gender: Female
Posts: 2,820
Location: S.F Bay Area

05 Jul 2016, 4:21 pm

"Inside" and "Outside" refer to the two networks on either side of the router's firewall. Your computers are on the inside, the Internet is on the outside.

According to the manual I found online for your router, your assumption is correct. The default settings/functionality are:
- Traffic between systems on the inside are not restricted
- Traffic originating from the outside is blocked on all ports


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

06 Jul 2016, 12:10 am

Edenthiel wrote:
"Inside" and "Outside" refer to the two networks on either side of the router's firewall. Your computers are on the inside, the Internet is on the outside.

According to the manual I found online for your router, your assumption is correct. The default settings/functionality are:
- Traffic between systems on the inside are not restricted
- Traffic originating from the outside is blocked on all ports

So I should be safe to set up SSH and VNC servers?


_________________
Every day is exactly the same...


dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

06 Jul 2016, 10:21 am

mr_bigmouth_502 wrote:
Edenthiel wrote:
"Inside" and "Outside" refer to the two networks on either side of the router's firewall. Your computers are on the inside, the Internet is on the outside.

According to the manual I found online for your router, your assumption is correct. The default settings/functionality are:
- Traffic between systems on the inside are not restricted
- Traffic originating from the outside is blocked on all ports

So I should be safe to set up SSH and VNC servers?


Yes you are, routers call open ports port forwarding, look in your routers settings and if nothing is listed as a forwarded port. You are good but you can also create individual rules between systems with iptables which is available for Linux.

I open some ports via port forwarding but only when I need them and I haven't lately, unless you want a server accessible over the internet then you never need to open any ports via port forwarding. Never setup a server unless you know what your doing, I have had my data accessible over the internet but never without a login and a whitelist. If you don't know ahead of time what IP address you'll be using to access your network over the WAN then don't open yourself up to attacks. Also you can sometimes run servers with active real time disk encryption.



mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

06 Jul 2016, 1:01 pm

Thanks for all the advice! :D This should make setting things up on my home network a lot easier.


_________________
Every day is exactly the same...


mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

07 Jul 2016, 7:27 am

I found out my router's actually a lesser model, a T1200H instead of a T2200H. They appear to be part of the same family though. Should this affect the quality of its firewall?


_________________
Every day is exactly the same...


dcj123
Veteran
Veteran

User avatar

Joined: 2 Sep 2009
Gender: Male
Posts: 10,796

07 Jul 2016, 9:29 pm

mr_bigmouth_502 wrote:
I found out my router's actually a lesser model, a T1200H instead of a T2200H. They appear to be part of the same family though. Should this affect the quality of its firewall?


I don't know personally,

however...

It shouldn't since routers have kinda had a standard over the last few years so unless its very old then I would imagine its safe. I use the Netgear WNDR4300 and its good security wise, it has some flaws such as WPS which can be exploited to steal wifi but as far as firewall its decent so if you feel like getting a new router, thats an option.



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 57
Gender: Female
Posts: 2,820
Location: S.F Bay Area

08 Jul 2016, 5:16 pm

Nice router, it's about as powerful as a basic android tablet. The second digit (from the left) in the name T2200H refers to how many DSL lines it connects to. The T1200H is used for a single DSL line, while the T220H is used to bond two DSL lines for doubled bandwidth. Other than that capability they appear to be hardware and firmware identical.


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

09 Jul 2016, 9:16 am

It's not bad, it's certainly an improvement over previous Telus routers, and it has a surprising number of options under the hood. Of course, I still have to reset it once in a while.


_________________
Every day is exactly the same...


eric76
Veteran
Veteran

User avatar

Joined: 31 Aug 2012
Gender: Male
Posts: 10,660
Location: In the heart of the dust bowl

09 Jul 2016, 9:22 am

If you can edit the sshd_config file, you should be able to restrict the interfaces on which you can connect. Since you are talking about a router, I don't know if you can do that.

I have a number of servers running OpenBSD. One of the first things I do when setting them up is to configure the sshd_config file to restrict the types of connections one can make to ssh from various sources. For local addresses, the only restriction is in which accounts can be logged into. For connections from outside my network, the list of accounts that can be logged into is greatly reduce and all connections must be done with the use of an RSA key instead of just username and password.



eric76
Veteran
Veteran

User avatar

Joined: 31 Aug 2012
Gender: Male
Posts: 10,660
Location: In the heart of the dust bowl

09 Jul 2016, 9:23 am

That's very strange. In the previous post I originally had the entire path to the sshd_config file and the braindead bogus security from cloudflare interpreted that as an attack on the server and blocked it. By removing the path and leaving only the file name, it permitted the post.

What kind of s**theads run cloudflare? I would certainly never recommend it to anyone.



mr_bigmouth_502
Veteran
Veteran

User avatar

Joined: 12 Dec 2013
Age: 31
Gender: Non-binary
Posts: 7,028
Location: Alberta, Canada

09 Jul 2016, 3:18 pm

eric76 wrote:
That's very strange. In the previous post I originally had the entire path to the sshd_config file and the braindead bogus security from cloudflare interpreted that as an attack on the server and blocked it. By removing the path and leaving only the file name, it permitted the post.

What kind of s**theads run cloudflare? I would certainly never recommend it to anyone.

Maybe try using code tags. Like so:

Code:
This is code.


_________________
Every day is exactly the same...