ayezee33
Posts: 15
Joined: Tue Feb 25, 2014 12:15 am

I can ssh via WAN but not LAN

Fri May 23, 2014 3:25 am

Hello,

I did a search here/Google and have found plenty of people struggling to connect via WAN. I have the opposite problem. My connect times out when trying to connect via LAN.

I am using a Model B connected via Ethernet. I am running pfSense (both pi and firewall are newest versions) and have a NAT rule established for port forwarding on 22. I have my sshd configured right (I think) because when I turn wifi off on my phone I can ssh in no problem. I also can connect from work.

Any thoughts? Links? Places for me to start looking?

Thanks

ayezee33
Posts: 15
Joined: Tue Feb 25, 2014 12:15 am

Re: I can ssh via WAN but not LAN

Fri May 23, 2014 3:35 am

Sorry to waste space on the boards, but I am going to answer my own question and maybe this will help someone else out.

I found that it has to do with NAT reflection. I found an article describing my problem and then went into pfSense under
Systems>Advanced>Firewall/NAT and selected NAT+proxy

I can now SSH into my pi.

ayezee33
Posts: 15
Joined: Tue Feb 25, 2014 12:15 am

Re: I can ssh via WAN but not LAN

Wed Jul 16, 2014 5:12 am

Maybe I didn't fully understand the issue and situation. Now when I try this it will not work. I will report back when I figure it out.

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: I can ssh via WAN but not LAN

Wed Jul 16, 2014 7:47 am

Yes, some routers have this NAT reflection issue. From a device on the LAN you try to access another device on the LAN by using the WAN IP address and port forwarding on the router. If it does not work because the router is the problem there is nothing on the RPi you can do to make it work.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: I can ssh via WAN but not LAN

Wed Jul 16, 2014 1:39 pm

Hi I think this is called "SSL hairpinning" and some routers (eg BT Home Hubs) disable it as a security measure. It is not a bug, it is a feature.
Unix engineer since 1989

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: I can ssh via WAN but not LAN

Wed Jul 16, 2014 1:40 pm

Just to add, you can use the home network address (192.168...) and it should work from home. But use your external facing IP address and the router will block it.
Unix engineer since 1989

ayezee33
Posts: 15
Joined: Tue Feb 25, 2014 12:15 am

Re: I can ssh via WAN but not LAN

Wed Jul 16, 2014 4:41 pm

I figured out what it was. As mentioned I have pfsense running and it does all my routing as well.

I was trying to make a Firewall Rule for the WAN when in reality if you do a NAT/port forward it automatically creates the rule and worked for me.

Return to “Troubleshooting”