Router – set route on OpenWRT for PPPoE and LAN

openwrtrouterouter

I have a HUAWEI wireless router running OpenWRT.

The router accesses the Internet with PPPoE.
Meanwhile it has an Ethernet address with the following configuration in a LAN (Local Area Network):

Address: 10.100.219.174
NetMask: 255.255.255.0
Gateway: 10.100.219.254

I want to access both the internet and the LAN, so I connect the PPPoE and then set the route using route command. After that the route table is:

Destination Gateway Genmask Flags MSS Window irtt Iface
default 58.247.228.1 0.0.0.0 UG 0 0 0 pppoe-wan
10.0.0.0 10.100.219.254 255.0.0.0 UG 0 0 0 eth2.1
10.100.219.0 * 255.255.255.0 U 0 0 0 eth2.1
58.247.228.1 * 255.255.255.255 UH 0 0 0 pppoe-wan
192.168.0.0 * 255.255.255.0 U 0 0 0 br-lan

At this point I can acccess both the Internet and the LAN on the router (I can ping google and any LAN address).

But on my laptop (which connects to the router), I can only access the Internet. If I try to access some LAN address (10.20.2.12) which is surely up, it tells me:


PING 10.20.2.12 (10.20.2.12): 56 data bytes
Request timeout for icmp_seq 0
92 bytes from openwrt.lan (192.168.0.1): Destination Port Unreachable
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst
4 5 00 5400 bded 0 0000 3f 01 f04f 192.168.0.164 10.20.2.12

Did I miss some step?

Best Answer

First, the network you are trying to route exists twice: 10.0.0.0/8 contains the network of 10.100.0.0/24. In this case, it is likely that the host you are trying to reach (on Eth2.1) does not know where to send its answer; openwrt uses the default gateway (which implies NAT when you are using WAN connections) for the packet that are comming back - if they are.

Just check if the correct gateway is set on the host(s) that you are trying to reach. Second check if there are packets at all (using wireshark or similar) on the second network; if there are, look for the destination address. There maybe a wrong (/8) Subent mask on the 'routed' device.

If not, use another IP-Range that is not included in your LAN range.

Related Topic