[PBR] network is not restored after interface is down
Open
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
@stangri Can you take a look?
here's the content of my /etc/config/pbr
Notice that option strict_enforcement is set to 0.
config pbr 'config'
option enabled '1'
option verbosity '2'
option strict_enforcement '0'
option resolver_set 'none'
list resolver_instance '*'
option ipv6_enabled '0'
list ignored_interface 'vpnserver'
option boot_timeout '30'
option rule_create_option 'add'
option procd_boot_delay '0'
option procd_reload_delay '1'
option webui_show_ignore_target '0'
option nft_rule_counter '0'
option nft_set_auto_merge '1'
option nft_set_counter '0'
option nft_set_flags_interval '1'
option nft_set_flags_timeout '0'
option nft_set_policy 'performance'
list webui_supported_protocol 'all'
list webui_supported_protocol 'tcp'
list webui_supported_protocol 'udp'
list webui_supported_protocol 'tcp udp'
list webui_supported_protocol 'icmp'
config include
option path '/usr/share/pbr/pbr.user.aws'
option enabled '0'
config include
option path '/usr/share/pbr/pbr.user.netflix'
option enabled '0'
config dns_policy
option name 'Redirect Local IP DNS'
option src_addr '192.168.1.5'
option dest_dns '1.1.1.1'
option enabled '0'
config policy
option name 'Ignore Local Requests'
option interface 'wan'
option dest_addr '192.168.0.0/16'
option enabled '0'
config policy
option name 'Discord'
option dest_addr 'discord.com discord.gg discordapp.net discordapp.com discord.media'
option interface 'cloudflare'
config policy
option name 'LTE'
option interface 'wwan'
option src_addr '192.168.1.2 192.168.1.7'
config policy
option name 'all'
option interface 'cloudflare'
option dest_addr '0.0.0.0/0'
option enabled '0'
- lets do a clean start
I havewwaninterface created to connect my phone's LTE connection via android hotspot.
wwan is down now, noticeSetting up routing for 'wwan/phy1-sta0/0.0.0.0' [✗]
root@router-sinan:~# service pbr restart
Resetting chains and sets [✓]
Removing routing for 'wan/192.168.2.1' [✓]
Removing routing for 'cloudflare/172.16.0.2' [✓]
Removing routing for 'wwan/phy1-sta0/0.0.0.0' [✓]
pbr 1.1.8-r4 (fw4 nft file mode) stopped [✓]
Using wan interface (on_start): wan
Found wan gateway (on_start): 192.168.2.1
Setting up routing for 'wan/192.168.2.1' [✓]
Setting up routing for 'cloudflare/172.16.0.2' [✓]
Setting up routing for 'wwan/phy1-sta0/0.0.0.0' [✗]
Routing 'Discord' via cloudflare [✓]
Routing 'LTE' via wwan [✓]
Installing fw4 nft file [✓]
pbr 1.1.8-r4 monitoring interfaces: wan cloudflare wwan
pbr 1.1.8-r4 (fw4 nft file mode) started with gateways:
wan/192.168.2.1 [✓]
cloudflare/172.16.0.2
ERROR: Failed to set up 'wwan/phy1-sta0/0.0.0.0'!
ERROR: Failed to resolve 'discordapp.net'!
WARNING: Please set 'dhcp.lan.force=1' to speed up service start-up.
- ping works fine
root@router-sinan:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=119 time=25.223 ms
64 bytes from 8.8.8.8: seq=1 ttl=119 time=24.316 ms
64 bytes from 8.8.8.8: seq=2 ttl=119 time=24.564 ms
64 bytes from 8.8.8.8: seq=3 ttl=119 time=26.630 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 24.316/25.183/26.630 ms
- Turning on AndroidAP hotspot on my phone, wwan connects to it.
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: SME: Trying to authenticate with XX:XX:XX:XX:XX:XX (SSID='AndroidAP' freq=2412 MHz)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.844902] phy1-sta0: authenticate with XX:XX:XX:XX:XX:XX (local address=d8:ec:e5:63:18:ca)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.844960] phy1-sta0: send auth to XX:XX:XX:XX:XX:XX (try 1/3)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.863706] phy1-sta0: send auth to XX:XX:XX:XX:XX:XX (try 2/3)
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: SME: Trying to authenticate with XX:XX:XX:XX:XX:XX (SSID='AndroidAP' freq=2412 MHz)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.894573] phy1-sta0: authenticate with XX:XX:XX:XX:XX:XX (local address=d8:ec:e5:63:18:ca)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.894624] phy1-sta0: send auth to XX:XX:XX:XX:XX:XX (try 1/3)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.905809] phy1-sta0: authenticated
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: PMKSA-CACHE-ADDED XX:XX:XX:XX:XX:XX 1
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: Trying to associate with XX:XX:XX:XX:XX:XX (SSID='AndroidAP' freq=2412 MHz)
Sun Jan 19 22:50:02 2025 daemon.notice netifd: Network device 'phy1-sta0' link is up
Sun Jan 19 22:50:02 2025 daemon.notice netifd: Interface 'wwan' has link connectivity
Sun Jan 19 22:50:02 2025 daemon.notice netifd: Interface 'wwan' is setting up now
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.917534] phy1-sta0: associate with XX:XX:XX:XX:XX:XX (try 1/3)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.923937] phy1-sta0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=0x1431 status=0 aid=2)
Sun Jan 19 22:50:02 2025 kern.info kernel: [430166.925302] phy1-sta0: associated
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: Associated with XX:XX:XX:XX:XX:XX
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Sun Jan 19 22:50:02 2025 kern.debug kernel: [430166.931790] phy1-sta0: Limiting TX power to 20 (20 - 0) dBm as advertised by XX:XX:XX:XX:XX:XX
Sun Jan 19 22:50:02 2025 daemon.notice netifd: wwan (32288): udhcpc: started, v1.36.1
Sun Jan 19 22:50:02 2025 daemon.notice netifd: wwan (32288): udhcpc: broadcasting discover
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: WPA: Key negotiation completed with XX:XX:XX:XX:XX:XX [PTK=CCMP GTK=CCMP]
Sun Jan 19 22:50:02 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: CTRL-EVENT-CONNECTED - Connection to XX:XX:XX:XX:XX:XX completed [id=1 id_str=]
Sun Jan 19 22:50:02 2025 daemon.notice netifd: wwan (32288): udhcpc: broadcasting select for 192.168.20.238, server 192.168.20.219
Sun Jan 19 22:50:03 2025 daemon.notice netifd: wwan (32288): udhcpc: lease of 192.168.20.238 obtained from 192.168.20.219, lease time 3599
Sun Jan 19 22:50:03 2025 daemon.info avahi-daemon[3849]: Joining mDNS multicast group on interface phy1-sta0.IPv4 with address 192.168.20.238.
Sun Jan 19 22:50:03 2025 daemon.info avahi-daemon[3849]: New relevant interface phy1-sta0.IPv4 for mDNS.
Sun Jan 19 22:50:03 2025 daemon.info avahi-daemon[3849]: Registering new address record for 192.168.20.238 on phy1-sta0.IPv4.
Sun Jan 19 22:50:03 2025 daemon.notice netifd: Interface 'wwan' is now up
Sun Jan 19 22:50:03 2025 user.notice firewall: Reloading firewall due to ifup of wwan (phy1-sta0)
Sun Jan 19 22:50:04 2025 user.notice pbr [32307]: Reloading routing for 'wwan/phy1-sta0/192.168.20.219' [✓]
Sun Jan 19 22:50:04 2025 user.notice pbr: Sending reload signal to pbr due to firewall action: includes
Sun Jan 19 22:50:04 2025 user.notice pbr: Reusing the fw4 nft file.
Sun Jan 19 22:50:04 2025 daemon.info avahi-daemon[3849]: Joining mDNS multicast group on interface phy1-sta0.IPv6 with address fe80::daec:e5ff:fe63:18ca.
Sun Jan 19 22:50:04 2025 daemon.info avahi-daemon[3849]: New relevant interface phy1-sta0.IPv6 for mDNS.
Sun Jan 19 22:50:04 2025 daemon.info avahi-daemon[3849]: Registering new address record for fe80::daec:e5ff:fe63:18ca on phy1-sta0.*.
- ping works fine
root@router-sinan:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=111 time=59.775 ms
64 bytes from 8.8.8.8: seq=1 ttl=111 time=32.139 ms
64 bytes from 8.8.8.8: seq=2 ttl=111 time=42.506 ms
64 bytes from 8.8.8.8: seq=3 ttl=111 time=35.967 ms
64 bytes from 8.8.8.8: seq=4 ttl=111 time=35.872 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 32.139/41.251/59.775 ms
- Turned off AndroidAP hotspot on my phone
Sun Jan 19 22:50:55 2025 daemon.notice netifd: Network device 'phy1-sta0' link is down
Sun Jan 19 22:50:55 2025 daemon.notice netifd: Interface 'wwan' has link connectivity loss
Sun Jan 19 22:50:55 2025 kern.info kernel: [430219.703076] phy1-sta0: disassociated from XX:XX:XX:XX:XX:XX (Reason: 1=UNSPECIFIED)
Sun Jan 19 22:50:55 2025 daemon.notice netifd: wwan (32288): udhcpc: received SIGTERM
Sun Jan 19 22:50:55 2025 daemon.notice netifd: wwan (32288): udhcpc: unicasting a release of 192.168.20.238 to 192.168.20.219
Sun Jan 19 22:50:55 2025 daemon.notice netifd: wwan (32288): udhcpc: sending release
Sun Jan 19 22:50:55 2025 daemon.notice netifd: wwan (32288): udhcpc: entering released state
Sun Jan 19 22:50:55 2025 daemon.notice netifd: wwan (32288): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "wwan" } (Permission denied)
Sun Jan 19 22:50:55 2025 daemon.notice netifd: Interface 'wwan' is now down
Sun Jan 19 22:50:55 2025 daemon.info avahi-daemon[3849]: Withdrawing address record for 192.168.20.238 on phy1-sta0.
Sun Jan 19 22:50:55 2025 daemon.info avahi-daemon[3849]: Leaving mDNS multicast group on interface phy1-sta0.IPv4 with address 192.168.20.238.
Sun Jan 19 22:50:55 2025 daemon.info avahi-daemon[3849]: Interface phy1-sta0.IPv4 no longer relevant for mDNS.
Sun Jan 19 22:50:55 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: CTRL-EVENT-DISCONNECTED bssid=XX:XX:XX:XX:XX:XX reason=1
Sun Jan 19 22:50:55 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: Added BSSID XX:XX:XX:XX:XX:XX into ignore list, ignoring for 10 seconds
Sun Jan 19 22:50:56 2025 user.notice pbr [1193]: Reloading routing for 'wwan/phy1-sta0/0.0.0.0' [✓]
Sun Jan 19 22:50:57 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: Removed BSSID XX:XX:XX:XX:XX:XX from ignore list (clear)
Sun Jan 19 22:50:57 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: SME: Trying to authenticate with XX:XX:XX:XX:XX:XX (SSID='AndroidAP' freq=2412 MHz)
Sun Jan 19 22:50:57 2025 kern.info kernel: [430221.297788] phy1-sta0: authenticate with XX:XX:XX:XX:XX:XX (local address=d8:ec:e5:63:18:ca)
Sun Jan 19 22:50:57 2025 kern.info kernel: [430221.297838] phy1-sta0: send auth to XX:XX:XX:XX:XX:XX (try 1/3)
Sun Jan 19 22:50:57 2025 kern.info kernel: [430221.311197] phy1-sta0: send auth to XX:XX:XX:XX:XX:XX (try 2/3)
Sun Jan 19 22:50:57 2025 kern.info kernel: [430221.314191] phy1-sta0: send auth to XX:XX:XX:XX:XX:XX (try 3/3)
Sun Jan 19 22:50:57 2025 kern.info kernel: [430221.320127] phy1-sta0: authentication with XX:XX:XX:XX:XX:XX timed out
Sun Jan 19 22:50:57 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: Added BSSID XX:XX:XX:XX:XX:XX into ignore list, ignoring for 10 seconds
Sun Jan 19 22:50:59 2025 daemon.notice wpa_supplicant[2566]: phy1-sta0: Removed BSSID XX:XX:XX:XX:XX:XX from ignore list (clear)
- network gets completely down, nothing works. Can't even connect to the main modem via wan
root@router-sinan:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network unreachable
root@router-sinan:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network unreachable
- only restarting network service fixes the problem
root@router-sinan:~# service network restart
root@router-sinan:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=119 time=25.273 ms
64 bytes from 8.8.8.8: seq=1 ttl=119 time=24.927 ms
64 bytes from 8.8.8.8: seq=2 ttl=119 time=24.471 ms
64 bytes from 8.8.8.8: seq=3 ttl=119 time=24.681 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 24.471/24.838/25.273 ms
root@router-sinan:~#
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with /etc/config/pbr and reproduce the sequence of bringing wwan up, disabling the Android hotspot, and observing the pbr reload logs. Compare the reported successful wwan reload with the resulting loss of WAN connectivity and the recovery after service network restart. Done means the main network remains reachable after wwan goes down without restarting the network service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100