7

In my home network, I connect to the Internet through a router (192.168.1.1). I also have another router (192.168.1.15, 192.168.2.1), this one using OpenWRT, configured as a wireless client. One of my computers is connected to that router via an Ethernet cable, which is connected to my main router wirelessly.

Due to being connected through the OpenWRT router, my computer (192.168.2.4) is on a different subnet. I have a static route set up on my main router for this. The destination network is set as 192.168.2.0, the subnet mask is 255.255.255.0, and the gateway is set as 192.168.1.15. This computer can access both the Internet and other computers on the network without trouble.

Anyway, from a computer in subnet 192.168.1.x, I can ping 192.168.1.15 and 192.168.2.1 (both IP addresses of my OpenWRT router) just fine. However, when I try to ping 192.168.2.4, I get the following message:

PING 192.168.2.4 (192.168.2.4) 56(84) bytes of data.
From 192.168.1.15 icmp_seq=1 Destination Port Unreachable

Clearly it's using the static route I assigned. The problem seems to be that the OpenWRT router doesn't know how to route packets to 192.168.2.4, which is strange because that IP is directly connected to that router.

What am I doing wrong?

2
  • Is IP forwarding enabled on that router? Apr 23 '13 at 18:43
  • I'm experiencing the same issue, two subnets and openwrt. Do you find out a solution?
    – jayatubi
    Jun 12 '16 at 3:56
10

1 year late but your problem might be the OpenWRT firewall which seems to forbid ip forwarding on the LAN interface when the source&destination subnets aren't the same. retry pinging after this one : /etc/init.d/firewall stop

if it works, then u gonna have fun with the rules !

2
  • Should I create two zones with different lan interface and then add a new forward rule for them? Just like the default lan => wan?
    – jayatubi
    Jun 12 '16 at 3:59
  • I was also getting 'port unreachable'. When I stopped the firewall, I got 'timed out' response. then I started again and it started working. Jan 12 '18 at 8:42
1

Similar error fixed by opening good old dos window (search for "cmd"), and typing these 3 separate lines:

ipconfig/release  
ipconfig/renew
exit
1
  • It would help to explain how these two commands solve the problem. May 30 '15 at 8:27
0

Might not be a solution, but did you check if your gateway is configured correctly? As the gateway is connected to both the systems, ping might be working just fine, but did you check if the gateway does the routing from 192.168.1.x to 192.168.2.x?

Do check the request and responses using Wireshark on the gateway.

1
  • I can SSH from 192.168.1.x to 192.168.1.15, but not from 192.168.1.x to 192.168.2.1. Ping works in both cases though. I reconfigured the firewall to allow forwarding in all cases, but pinging 192.168.2.4 from 192.168.1.x still doesn't work. It doesn't give me the destination port unreachable error anymore though. I checked with tcpdump and it is receiving the ping request for 192.168.2.4, but for whatever reason 192.168.2.4 isn't responding. 192.168.2.4 normally does respond to ping though, as I can ping it from 192.168.2.1.
    – flarn2006
    Apr 23 '13 at 20:25
0

I got a very similar setup (OpenWrt, a couple of subnets). Same issue. When i turn of the firewall I don't get any message back anymore and have 100% packet loss. I seem to be able to use all TCP services I tried so far (ssh, smb) so the routing clearly works. I also tried pinging the target hosts from different subnets that dont go through this very router and have no problems in receiveing an echo reply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.