How can I ping directly from a device on the LAN interface to a device on the WAN interface?

Hi everyone,

I use the 8devices Lima router for the network as shown below: The PC connects to the port ETH0 (LAN interface) and the IP camera connects to the port ETH1 (WAN interface) on the router.

I know that it is easy if both devices have the same interface, but I wonder if there is another way to ping directly from the PC to the camera even if it is on two different interfaces (without using the redirect method). I would appreciate any information you can provide.

Here are my network and firewall config files.

etc/config/network:

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd54:12e2:651f::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config device
        option name 'br-wan'
        option type 'bridge'
        option ports 'eth1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'br-wan'
        option proto 'static'
        option ipaddr '10.223.159.252'
        option netmask '255.255.0.0'

and etc/config/firewall:

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'wan'
        list network 'wan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

Hi

according to your schematic and network settings, it should work

do you tried to ping camera directly from OWRT router ?

1 Like

On the router, I can ping to the PC's IP of 192.168.1.106 and the camera's IP of 10.223.0.191. However, when I ping directly from my PC to IP 10.223.0.191 I get the following issue:

  • After rebooting the router, I can ping from the PC to the camera.
  • But if I use Putty and connect to the router through the address 192.168.1.1:22 (SSH protocol) and then ping to the camera, the result is "Request timed out".

I use the openwrt-22.03.5 firmware provided here.

You can verify that the ping is received by the OpenWrt and then sent to the camera.
opkg update; opkg install tcpdump; tcpdump -i any -nv icmp and host 10.223.0.191
Run a few pings and post here the output.

1 Like

I just found out the problem is that my power supply is unstable. After replacing it with a new one, everything seems to be working properly with the above configurations. Ty.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.