Reply
New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Edgerouter X - can't connect to local devices inside LAN

i've just installed an Edgerouter X (v1.10.3)

DSL modem connected to eth0 (PPPoE) - internet access is fine.

eth1-4 are just plain LAN ports

1 LAN on 192.168.1.x

 

i have a firewall rules set to open a small set of ports for WAN connection IN - these are working ok.

however when i try to connect to a local device from inside the LAN it fails... ie http://192.168.1.2:8787

 

i'm assuming i must have the firewall rules set wrong.

 

can anyone point me in the right direction? i'm new to EdgeOS.

Capture.JPG

 

Capture.JPG

SuperUser
Posts: 6,489
Registered: ‎01-05-2012
Kudos: 1710
Solutions: 831

Re: Edgerouter X - can't connect to local devices inside LAN

Actually, if devices are in the same broadcast domain, these devices can talk amongst each other without that the firewall/router is involved.
If you connect devices to a simple switch, do they communicate fine ?
Cheers,
jonatha

Member
Posts: 727
Registered: ‎09-24-2017
Kudos: 139
Solutions: 57

Re: Edgerouter X - can't connect to local devices inside LAN

At face value, your issue shouldn't exist if you have a single LAN and are trying to access your device from inside the LAN via the LAN address. That is because the firewall and routing functions are not involved for L2 communications.

 

you should first check to make sure that 192.168.1.2 has an active service on port 8787 and that it is not blocked by a local (host-level) firewall -- your port forwarding rules only show 80 and 32400. This can be done on that host by trying to connect to localhost:8787.

 

Otherwise, we'll need to see your full (sanitized where necessary) configuration to help any further. Please copy and paste the output into a spoiler + code tag:

show configuration | cat
New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

8787 is not open on the external firewall because nginx takes the traffic on port 80 and then passes it to port 8787 locally.

this is why i know 8787 is working because externally i can access the service.

also, if i jump on to 192.168.1.2 and load http://localhost:8787 it loads fine.

this confirms that the service is running and on that port.

 

nothing has changes with regards to server config. only change is edgerouter replacing existing router.

 

here is the config

SuperUser
Posts: 6,489
Registered: ‎01-05-2012
Kudos: 1710
Solutions: 831

Re: Edgerouter X - can't connect to local devices inside LAN

Whas working with the previous router ? Is Not clear, if nginx redirect the tcp 80 to tcp 8787... Did you try by typing your public ip address/fqdn:80 from inside your lan ?

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

everyting worked as expected on old router.
i have tried both the FQDN and the local IP address from inside my network - both fail
outside my network FQDN connects fine.

to clarify nginx (which runs on 192.168.1.2 on port 80), blah.com/servicename nginx direct to port 8787 internally via a reverse proxy.
however the nginx part is irrlevant here.
SuperUser
Posts: 6,489
Registered: ‎01-05-2012
Kudos: 1710
Solutions: 831

Re: Edgerouter X - can't connect to local devices inside LAN

Can you try
sudo tcpdump -ni switch0 host 192.168.1.2 and port 80
Then, from another host connected to the switch0 (eg the host 192.168.1.10), type
http://<your.fqdn/public.ip.address>

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

what will that do first of all? so i know what this is changing.
Highlighted
SuperUser
Posts: 6,489
Registered: ‎01-05-2012
Kudos: 1710
Solutions: 831

Re: Edgerouter X - can't connect to local devices inside LAN

Is only for check if hairpin nat is properly working, we should see packets sourced from 192.168.1.1 and destined to 192.168.1.2, on port 80 (and, usually, even the responses ...)

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

[ Edited ]
ubnt@ubnt:~$ sudo tcpdump -ni switch0 host 192.168.1.2 and port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on switch0, link-type EN10MB (Ethernet), capture size 262144 bytes
18:55:35.749784 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [P.], seq 2387596487:2387597309, ack 11148410, win 253, length 822: HTTP: POST /transmission/rpc HTTP/1.1
18:55:35.752136 IP 192.168.1.2.80 > 192.168.1.1.54263: Flags [P.], seq 1:290, ack 822, win 256, length 289: HTTP: HTTP/1.1 200 OK
18:55:35.794706 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [.], ack 290, win 252, length 0
18:55:56.747513 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [P.], seq 822:1397, ack 290, win 252, length 575: HTTP: GET /212.159.113.54 HTTP/1.1
18:55:56.748223 IP 192.168.1.2.80 > 192.168.1.1.54263: Flags [P.], seq 290:1002, ack 1397, win 254, length 712: HTTP: HTTP/1.1 404 Not Found
18:55:56.790398 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [.], ack 1002, win 256, length 0
18:55:56.957079 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [P.], seq 1397:1941, ack 1002, win 256, length 544: HTTP: GET /favicon.ico HTTP/1.1
18:55:56.957497 IP 192.168.1.2.80 > 192.168.1.1.54263: Flags [P.], seq 1002:1714, ack 1941, win 252, length 712: HTTP: HTTP/1.1 404 Not Found
18:55:56.998682 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [.], ack 1714, win 253, length 0
18:56:05.752000 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [P.], seq 1941:2763, ack 1714, win 253, length 822: HTTP: POST /transmission/rpc HTTP/1.1
18:56:05.755329 IP 192.168.1.2.80 > 192.168.1.1.54263: Flags [P.], seq 1714:2003, ack 2763, win 256, length 289: HTTP: HTTP/1.1 200 OK
18:56:05.797704 IP 192.168.1.1.54263 > 192.168.1.2.80: Flags [.], ack 2003, win 252, length 0

 

that was just a small section, it was continuing for quite some time.

 

should add, that my unifi controller that runs on 192.168.1.2 also cannot be connected to by any local device other than the host.

so clearly something is very wrong with internal LAN connections.

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

i did post a reply with results, but it seems to have disappeared!
Member
Posts: 727
Registered: ‎09-24-2017
Kudos: 139
Solutions: 57

Re: Edgerouter X - can't connect to local devices inside LAN

Your config file looks fine. I suspect this is an issue with your nginx configuration.

 

@redfive had suggested connecting your devices to a simple switch (unmanaged, not a router). Try that -- if you still cannot connect, your problem is certainly not related to your Edgerouter.

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

i would have thought so too, but nginx hasn't changed.
basically it's been working for months, disconnected the old router, connected the new one, configured it then re-connected the server.
end result, not working.

i don't have a simple switch to test, but the only change in the config is the edgerouter replacing a fritzbox.

i'll try rebooting everything and see what happens.
New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

ok an update

 

local devices are now accessible using their IP address and port.
however when i try to connect to my server using the FQDN it fails when on the LAN

 

when i'm on my LAN
http://192.168.1.2:7878 works
http://blah.com/service doesn't work (i use nginx to reverse proxy it to 192.168.1.2:7878), i get a 404 error.

 

when off my network
http://blah.com/service does work correctly.

 

so nginx is working when i'm not on my LAN.

 

previously on old router it worked on both LAN and WAN.

SuperUser
Posts: 6,489
Registered: ‎01-05-2012
Kudos: 1710
Solutions: 831

Re: Edgerouter X - can't connect to local devices inside LAN

Odd enough, is possible that nginx does the redirect only for connections coming from remote networks (and not its own network) ?

Cheers,

jonatha

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

Nope.
As said, it was working up until the router was swapped.
SuperUser
Posts: 6,489
Registered: ‎01-05-2012
Kudos: 1710
Solutions: 831

Re: Edgerouter X - can't connect to local devices inside LAN

So, if you type, from within the lan, http://192.168.1.2:7878 , it works, and if you type simply http://192.168.1.2 ?

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

Yes that's correct.
And for the other i get the home page for nginx as port 80 is it's port. Which is the correct outcome
Member
Posts: 727
Registered: ‎09-24-2017
Kudos: 139
Solutions: 57

Re: Edgerouter X - can't connect to local devices inside LAN

[ Edited ]

what about when you type:

http://192.168.1.2/service

Does that work as expected? (or better yet, please describe the result.)

New Member
Posts: 55
Registered: 2 weeks ago
Kudos: 5

Re: Edgerouter X - can't connect to local devices inside LAN

[ Edited ]

ok, some update, sorry for the delay.

 

internal LAN is now ok

eg 192.168.1.2:7878 works fine.

192.168.1.2/service works fine.

 

however, it appears that even though i've opened ports on the firewall for incoming external traffic they are not open.

i've checked the ports using one of those website that checks and they have all come back as closed.

 

Capture.JPG

Reply