The problem I'm facing are quite similar to this post: How to setup isolated double NAT
But I can't properly apply the solution. Solution, as was accepted in the above post, says to
"put eth0 as your physical device for the WAN"
, but how do I do it? When I put the ethernet cable that comes out of the LAN port of my primary router in my Openwrt device (a RPi 3), it gets recognized as LAN, how I convert it into WAN?
My Device connection layout:
Internet <-----> Primary Router <---- [ethernet cable] ---> OpenWRT device
I wan openwrt device to be a NAT device.
Please enlighten me on topic.
when not dealing with any of-the-shelf type WiFi-router:
the first NIC on a device is always a LAN port.
The second NIC is the WAN port
if there are more NICs they are by default inactive
(order I guess depends on MAC address order)
the RPI3 has 1 NIC, so that is LAN by default.
What you can do:
connect the RPI via Wifi to your main router, WAN will then be via Wifi
or add a USB-to-NIC adapter (though driver installation kind of requires a Wifi-based WAN first)
or create a Wifi on LAN, connect your client to that WiFi, then manually reassign the 1 NIC from the LAN interface to WAN interface (and it could be, you have to manually create a WAN interface first, as that might not be there by default on 1-NIC-devices).
What you have circled is the firewall zone assigned to that interface. Click on edit, then the firewall settings tab and you can choose the WAN zone where NAT is enabled by default.
Yes, but it's colored green which means that it is in the lan firewall zone. He needs to move it to the wan firewall zone (red color) where nat is enabled by default. Yes, the interface itself will still be named lan. Alternatively, he could delete the lan interface, and create a new one with the name of his choice, and put that one in the wan zone.
problem likely is: to move the only device NIC to WAN, the administrating client will have to be connected via Wifi, the Wifi connected to that LAN interface.
That is where a separate WAN interface is handy,
then unassigning the NIC from LAN interface and assign it to the WAN interface.
Nice. I've moved eth0 to WAN firewall zone and wlan to LAN zone. My wireless client is getting internet connection. But do I need to configure anything separately to get my wifi clients NATed internet connection through this WAN?
Moreover, I can't ping by wlan0.
The WiFi clients connected through this device are now behind a nat layer created by openwrt. And that is behind an upstream router, so those clients are double nat’d.
I’m not sure why you want to do this, but you have achieved your stated goal.
Wlan0 is your downstream network, so it makes sense you cannot ping upstream (and to the internet) this way. What are you trying to test or achieve in this situation?
Forwarding from a LAN user (wifi in this case) to the Internet (wired in this case) works because of the firewall. The default firewall settings assume that the two networks will be named lan and wan exactly. Since you've used other names you need to put the two new network names into the firewall zones.
The picture doesn't tell the whole story. Please post the following files:
Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
I think you're confused about which direction the packets are going. When one of your wireless devices send out a packet, the packet comes into wlan0 for forwarding. When you do ping -I wlan0 google.com on your router, a packet goes out of wlan0.
Inbound packets from wlan0 sent by your wireless devices are forwarded by your router to eth0 based on its routing table, and eth0 has a route that can get to google.com (usually via the default route).
Outbound packets to wlan0 can only go to the connected wireless devices, and unless one of those wireless devices is a router that has a route to google.com, you won't be able to reach google.com via any routes on wlan0.
Thanks rao.
I've another confusion here:
I see I can't communicate(ping) from a my openwrt device to a device connected to LAN of my primary router. As my Openwrt device is connected to the LAN of my primary router also, why can I not do that?
Can you please explain this for me?