Hi all. I am new to OpenWRT, but have installed it on Raspberry Pi which I have connected an additional USB Ethernet adapter too. All the hardware is functioning, but I need some help with the configuration.
I have 1 Ethernet port named mgmt which is connected to my network. The 2nd Ethernet port and WiFi I am hoping to use to provide my UniFi UDM Pro Max with a second WAN connection.
My thought is that the WiFi connection will connect to my hotspot on my phone and obtain its IP via DHCP.
The second Ethernet port I have named GW and connected to my 2nd WAN port. I have a DHCP server running on it so it provides the UDM with an IP.
To test, I have connected the GW interface to a second Ethernet port on my PC, but I can’t get any successful ping results through it.
I’m guessing I need to somehow bridge the two interfaces, but no matter what I try and what help articles/pages I follow I can’t seem to get it to work as expected.
Any advice please?
This would be a normal router setup.
- Do a WiFi scan and follow the wizard to create a new WWAN interfece attached to the WAN firewall zone
- If your 2nd Ethernet port is LAN, this should work after setup (unless your Hotspot and LAN have an addressing conflict)
Let's see your /etc/config/network - DHCP, and wireless if you have further issues.
1 Like
I have the device connected to my phone okay, there just doesn't seem to be any connectivity between the GW interface and the WiFi interface. I wonder if it something to do with routing?
root@GW-BACKUPWAN01:~# cat /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 'fdd5:d3fe:92c6::/48'
option packet_steering '1'
config interface 'mgmt'
option proto 'dhcp'
option device 'eth0'
option dns_metric '10'
option metric '10'
config device
option name 'eth0'
option ipv6 '0'
config device
option name 'eth1'
option ipv6 '0'
config interface 'gw'
option proto 'static'
option device 'eth1'
option ipaddr '192.168.123.1'
option netmask '255.255.255.0'
config interface 'wwan'
option proto 'dhcp'
option device 'phy0-sta0'
option metric '0'
config rule
option in 'gw'
option out 'wwan'
config rule
option in 'wwan'
option out 'gw'
mk24
4
Don't refer to wifi devices in /etc/config/network. The wwan interface should have no Device in the file. Use an option network 'wwan' setting in /etc/config/wireless to associate the sta to the network.
The mgmt interface should have defaultroute 0 and peerdns 0. Otherwise the router will try to use it to reach the Internet.
Once you get an IP from the phone make sure that its subnet does not overlap any of the other networks. Android used to use 192.168.43.0 but I think that has changed.
The config rule you have are not doing anything, are not needed, and should be removed.
wwan needs to be listed in the wan firewall zone.
I have made the recommended changes.
My F/W looks like this, so not sure if I can reset to defaults or if what I have is adequote?
192.168.123.172 is the IP the router has given to my client and I have tried to ping 1.1.1.1 through this, but get the following:
C:\Users\terry>ping -S 192.168.123.172 1.1.1.1
Pinging 1.1.1.1 from 192.168.123.172 with 32 bytes of data:
Reply from 192.168.123.1: Destination port unreachable.
Request timed out.
Reply from 192.168.123.1: Destination port unreachable.
Reply from 192.168.123.1: Destination port unreachable.
Ping statistics for 1.1.1.1:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
mk24
6
Your packet made it to the phone but the phone was unable to forward it to the Internet. Does the Internet work when you connect a laptop etc. directly to the phone?
Yes, connected directly to my phone hotspot from my PC I am able to ping 1.1.1.1 successfully:-
C:\Users\terry>ping -S 172.20.10.2 1.1.1.1
Pinging 1.1.1.1 from 172.20.10.2 with 32 bytes of data:
Reply from 1.1.1.1: bytes=32 time=272ms TTL=54
Reply from 1.1.1.1: bytes=32 time=221ms TTL=54
Reply from 1.1.1.1: bytes=32 time=177ms TTL=54
Reply from 1.1.1.1: bytes=32 time=126ms TTL=54
Ping statistics for 1.1.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 126ms, Maximum = 272ms, Average = 199ms
How does the router know which interface gateway to use for internet access? The mgmt interface and wwan interface both provide a method to access the internet, but any traffic coming in via the gw interface should be passed out via the wwan interface