Thank you again for your help. After tripplechecking the configuration, the problem is the same as described. PBR is not working, each Internet traffic is going out over wan interface.
Thank you again for your offer to help me to check the config, please find them below:
root@OpenWrt:~# ubus call system board
{
"kernel": "6.6.110",
"hostname": "OpenWrt",
"system": "ARMv8 Processor rev 4",
"model": "GL.iNet GL-MT6000",
"board_name": "glinet,gl-mt6000",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "24.10.4",
"revision": "r28959-29397011cc",
"target": "mediatek/filogic",
"description": "OpenWrt 24.10.4 r28959-29397011cc",
"builddate": "1760891865"
}
}
root@OpenWrt:~# 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 'xxx:7b0e:5f7b::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'lan5'
option bridge_empty '1'
config interface 'lan'
option device 'br-lan.1'
option proto 'static'
option ipaddr '192.168.50.240'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth1'
option proto 'pppoe'
option username 'xxxx'
option password 'xxxx'
option ipv6 'auto'
option metric '10'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
option reqaddress 'try'
option reqprefix 'auto'
option norelease '1'
option metric '10'
config bridge-vlan
option device 'br-lan'
option vlan '1'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '20'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '30'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '40'
list ports 'lan4:t'
list ports 'lan5:t'
config interface 'Invitados'
option proto 'static'
option device 'br-lan.20'
option ipaddr '192.168.52.1'
option netmask '255.255.255.0'
config interface 'IOT'
option proto 'static'
option device 'br-lan.30'
option ipaddr '192.168.53.1'
option netmask '255.255.255.0'
config interface 'Kameras'
option proto 'static'
option device 'br-lan.40'
option ipaddr '192.168.54.1'
option netmask '255.255.255.0'
config interface 'wg0'
option proto 'wireguard'
option private_key xxx
list addresses '192.168.98.1/24'
config wireguard_wg0
option description 'flo-rt240'
option public_key xxxx
option preshared_key xxxx
list allowed_ips '192.168.60.0/24'
option endpoint_host xxx
option endpoint_port '59888'
option persistent_keepalive '25'
option route_allowed_ips '1'
config interface 'wg1'
option proto 'wireguard'
option private_key xxxx
option listen_port '51823'
list addresses '192.168.13.1/24'
config wireguard_wg1
option description 'S23'
option public_key xxxx
option private_key xxxx
option route_allowed_ips '1'
list allowed_ips '192.168.13.2/32'
config interface 'wg2'
option proto 'wireguard'
option private_key xxxx
list addresses '10.8.0.3/24'
list addresses 'xxxx:ad94:bacf:61a4::cafe:3/112'
list dns '1.1.1.1'
list dns '2606:4700:4700::1111'
option metric '20'
config wireguard_wg2
option public_key xxx
option preshared_key xxx
list allowed_ips '0.0.0.0/0'
list allowed_ips '::/0'
option endpoint_host xxx
option endpoint_port '51820'
option persistent_keepalive '0'
option route_allowed_ips '1'
config wireguard_wg1
option description 'Tab-S5e'
option public_key xxxx
option private_key xxxx
list allowed_ips '192.168.13.3/32'
option route_allowed_ips '1'
option persistent_keepalive '25'
--------------------------------------------------
cat /etc/config/firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
list network 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option masq '1'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'xxxx::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config zone
option name 'IOT'
option input 'REJECT'
option output 'ACCEPT'
option forward 'DROP'
option masq '1'
list device 'br-lan.30'
config zone
option name 'Invitados'
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
option masq '1'
list device 'br-lan.20'
option mtu_fix '1'
config zone
option name 'Kameras'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list device 'br-lan.40'
list network 'Kameras'
config forwarding
option src 'Invitados'
option dest 'wan'
config rule
option src 'Invitados'
option name 'Invitados-DNS'
option dest_port '53'
option target 'ACCEPT'
config rule
option src 'IOT'
option name 'IOT-DNS'
option dest_port '53'
option target 'ACCEPT'
config rule
option src 'Kameras'
option name 'Kameras-DNS'
option dest_port '53'
option target 'ACCEPT'
config rule
option src 'Invitados'
option name 'Invitados-DHCP'
option dest_port '67 68'
option target 'ACCEPT'
config rule
option src 'IOT'
option name 'IOT-DHCP'
option dest_port '67 68'
option target 'ACCEPT'
config rule
option src 'Kameras'
option name 'Kameras-DHCP'
option dest_port '67 68'
option target 'ACCEPT'
config redirect
option dest 'lan'
option target 'DNAT'
option name '80'
option src 'wan'
option src_dport '80'
option dest_ip '192.168.50.4'
option dest_port '81'
list proto 'tcp'
config redirect
option dest 'lan'
option target 'DNAT'
option name '443'
list proto 'tcp'
option src 'wan'
option src_dport '443'
option dest_ip '192.168.50.4'
option dest_port '443'
config zone
option name 'wg0'
option input 'REJECT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'wg0'
config forwarding
option src 'wg0'
option dest 'lan'
config forwarding
option src 'lan'
option dest 'wg0'
config zone
option name 'wg1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'wg1'
option masq '1'
option mtu_fix '1'
config redirect
option dest 'wg1'
option target 'DNAT'
option name 'wg1-51823'
list proto 'udp'
option src 'wan'
option src_dport '51823'
option dest_ip '192.168.50.240'
option dest_port '51823'
config forwarding
option src 'wg1'
option dest 'lan'
config forwarding
option src 'wg1'
option dest 'wan'
config forwarding
option src 'lan'
option dest 'Kameras'
config forwarding
option src 'Kameras'
option dest 'lan'
config forwarding
option src 'IOT'
option dest 'lan'
config forwarding
option src 'lan'
option dest 'IOT'
config zone
option name 'wg2'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wg2'
config forwarding
option src 'lan'
option dest 'wg2'
ip route show
default via 172.30.96.1 dev pppoe-wan proto static metric 10
default dev wg2 proto static scope link metric 20
10.8.0.0/24 dev wg2 proto static scope link metric 20
79.208.109.160 via 172.30.96.1 dev pppoe-wan proto static metric 10
87.106.80.244 via 172.30.96.1 dev pppoe-wan proto static metric 10
172.30.96.1 dev pppoe-wan proto kernel scope link src 185.205.58.41
192.168.13.0/24 dev wg1 proto kernel scope link src 192.168.13.1
192.168.13.2 dev wg1 proto static scope link
192.168.13.3 dev wg1 proto static scope link
192.168.50.0/24 dev br-lan.1 proto kernel scope link src 192.168.50.240
192.168.52.0/24 dev br-lan.20 proto kernel scope link src 192.168.52.1
192.168.53.0/24 dev br-lan.30 proto kernel scope link src 192.168.53.1
192.168.54.0/24 dev br-lan.40 proto kernel scope link src 192.168.54.1
192.168.60.0/24 dev wg0 proto static scope link
192.168.98.0/24 dev wg0 proto kernel scope link src 192.168.98.1
ip -6 route show
xxxx:7b0e:5f7b::/64 dev br-lan.1 proto static metric 1024 pref medium
unreachable xxxx:7b0e:5f7b::/48 dev lo proto static metric 2147483647 pref medium
xxxx:ad94:bacf:61a4::cafe:0/112 dev wg2 proto static metric 20 pref medium
xxxx::/64 dev eth0 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.1 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.20 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.30 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.40 proto kernel metric 256 pref medium
xxxx::/64 dev eth1 proto kernel metric 256 pref medium
default dev wg2 proto static metric 20 pref medium
ip route show table all
default via 192.168.98.1 dev wg0 table pbr_wg0
default via 172.30.96.1 dev pppoe-wan table pbr_wg0 proto static metric 10
79.208.109.160 via 172.30.96.1 dev pppoe-wan table pbr_wg0 proto static metric 10
87.106.80.244 via 172.30.96.1 dev pppoe-wan table pbr_wg0 proto static metric 10
172.30.96.1 dev pppoe-wan table pbr_wg0 proto kernel scope link src 185.205.58.41
192.168.13.0/24 dev wg1 table pbr_wg0 proto kernel scope link src 192.168.13.1
192.168.13.2 dev wg1 table pbr_wg0 proto static scope link
192.168.13.3 dev wg1 table pbr_wg0 proto static scope link
192.168.50.0/24 dev br-lan.1 table pbr_wg0 proto kernel scope link src 192.168.50.240
192.168.52.0/24 dev br-lan.20 table pbr_wg0 proto kernel scope link src 192.168.52.1
192.168.53.0/24 dev br-lan.30 table pbr_wg0 proto kernel scope link src 192.168.53.1
192.168.54.0/24 dev br-lan.40 table pbr_wg0 proto kernel scope link src 192.168.54.1
default via 10.8.0.3 dev wg2 table pbr_wg2
default via 172.30.96.1 dev pppoe-wan table pbr_wg2 proto static metric 10
79.208.109.160 via 172.30.96.1 dev pppoe-wan table pbr_wg2 proto static metric 10
87.106.80.244 via 172.30.96.1 dev pppoe-wan table pbr_wg2 proto static metric 10
172.30.96.1 dev pppoe-wan table pbr_wg2 proto kernel scope link src 185.205.58.41
192.168.13.0/24 dev wg1 table pbr_wg2 proto kernel scope link src 192.168.13.1
192.168.13.2 dev wg1 table pbr_wg2 proto static scope link
192.168.13.3 dev wg1 table pbr_wg2 proto static scope link
192.168.50.0/24 dev br-lan.1 table pbr_wg2 proto kernel scope link src 192.168.50.240
192.168.52.0/24 dev br-lan.20 table pbr_wg2 proto kernel scope link src 192.168.52.1
192.168.53.0/24 dev br-lan.30 table pbr_wg2 proto kernel scope link src 192.168.53.1
192.168.54.0/24 dev br-lan.40 table pbr_wg2 proto kernel scope link src 192.168.54.1
default via 172.30.96.1 dev pppoe-wan proto static metric 10
default dev wg2 proto static scope link metric 20
10.8.0.0/24 dev wg2 proto static scope link metric 20
79.208.109.160 via 172.30.96.1 dev pppoe-wan proto static metric 10
87.106.80.244 via 172.30.96.1 dev pppoe-wan proto static metric 10
172.30.96.1 dev pppoe-wan proto kernel scope link src 185.205.58.41
192.168.13.0/24 dev wg1 proto kernel scope link src 192.168.13.1
192.168.13.2 dev wg1 proto static scope link
192.168.13.3 dev wg1 proto static scope link
192.168.50.0/24 dev br-lan.1 proto kernel scope link src 192.168.50.240
192.168.52.0/24 dev br-lan.20 proto kernel scope link src 192.168.52.1
192.168.53.0/24 dev br-lan.30 proto kernel scope link src 192.168.53.1
192.168.54.0/24 dev br-lan.40 proto kernel scope link src 192.168.54.1
192.168.60.0/24 dev wg0 proto static scope link
192.168.98.0/24 dev wg0 proto kernel scope link src 192.168.98.1
local 10.8.0.3 dev wg2 table local proto kernel scope host src 10.8.0.3
broadcast 10.8.0.255 dev wg2 table local proto kernel scope link src 10.8.0.3
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
local 185.205.58.41 dev pppoe-wan table local proto kernel scope host src 185.205.58.41
local 192.168.13.1 dev wg1 table local proto kernel scope host src 192.168.13.1
broadcast 192.168.13.255 dev wg1 table local proto kernel scope link src 192.168.13.1
local 192.168.50.240 dev br-lan.1 table local proto kernel scope host src 192.168.50.240
broadcast 192.168.50.255 dev br-lan.1 table local proto kernel scope link src 192.168.50.240
local 192.168.52.1 dev br-lan.20 table local proto kernel scope host src 192.168.52.1
broadcast 192.168.52.255 dev br-lan.20 table local proto kernel scope link src 192.168.52.1
local 192.168.53.1 dev br-lan.30 table local proto kernel scope host src 192.168.53.1
broadcast 192.168.53.255 dev br-lan.30 table local proto kernel scope link src 192.168.53.1
local 192.168.54.1 dev br-lan.40 table local proto kernel scope host src 192.168.54.1
broadcast 192.168.54.255 dev br-lan.40 table local proto kernel scope link src 192.168.54.1
local 192.168.98.1 dev wg0 table local proto kernel scope host src 192.168.98.1
broadcast 192.168.98.255 dev wg0 table local proto kernel scope link src 192.168.98.1
unreachable default dev lo table pbr_wg0 metric 1024 pref medium
xxxx:ad94:bacf:61a4::cafe:0/112 dev wg2 table pbr_wg2 proto static metric 20 pref medium
default dev wg2 table pbr_wg2 proto static metric 20 pref medium
default dev wg2 table pbr_wg2 metric 128 pref medium
xxxx:7b0e:5f7b::/64 dev br-lan.1 proto static metric 1024 pref medium
unreachable xxxx:7b0e:5f7b::/48 dev lo proto static metric 2147483647 pref medium
xxxx:ad94:bacf:61a4::cafe:0/112 dev wg2 proto static metric 20 pref medium
xxxx::/64 dev eth0 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.1 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.20 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.30 proto kernel metric 256 pref medium
xxxx::/64 dev br-lan.40 proto kernel metric 256 pref medium
xxxx::/64 dev eth1 proto kernel metric 256 pref medium
default dev wg2 proto static metric 20 pref medium
local ::1 dev lo table local proto kernel metric 0 pref medium
anycast xxxx:7b0e:5f7b:: dev br-lan.1 table local proto kernel metric 0 pref medium
local xxxx:7b0e:5f7b::1 dev br-lan.1 table local proto kernel metric 0 pref medium
anycast xxxx:ad94:bacf:61a4::cafe:0 dev wg2 table local proto kernel metric 0 pref medium
local xxxx:ad94:bacf:61a4::cafe:3 dev wg2 table local proto kernel metric 0 pref medium
anycast xxxx:: dev eth0 table local proto kernel metric 0 pref medium
anycast xxxx:: dev br-lan.20 table local proto kernel metric 0 pref medium
anycast xxxx:: dev br-lan.1 table local proto kernel metric 0 pref medium
anycast xxxx:: dev br-lan table local proto kernel metric 0 pref medium
anycast xxxx:: dev br-lan.30 table local proto kernel metric 0 pref medium
anycast xxxx:: dev br-lan.40 table local proto kernel metric 0 pref medium
anycast xxxx:: dev eth1 table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1c9 dev eth1 table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1cb dev eth0 table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1cb dev br-lan.20 table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1cb dev br-lan.1 table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1cb dev br-lan table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1cb dev br-lan.30 table local proto kernel metric 0 pref medium
local xxxx::9683:c4ff:fea8:d1cb dev br-lan.40 table local proto kernel metric 0 pref medium
multicast xxxx::/8 dev br-lan.1 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev eth0 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev wg1 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev br-lan table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev br-lan.20 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev br-lan.30 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev br-lan.40 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev eth1 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev wg0 table local proto kernel metric 256 pref medium
multicast xxxx::/8 dev wg2 table local proto kernel metric 256 pref medium
ip rule show
0: from all lookup local
29998: from all fwmark 0x20000/0xxxxx00 lookup pbr_wg2
30000: from all fwmark 0x10000/0xxxxx00 lookup pbr_wg0
32766: from all lookup main
32767: from all lookup default
wg show
interface: wg0
public key: xxx
private key: (hidden)
listening port: 43434
peer: xxxx
preshared key: (hidden)
endpoint: 79.208.109.160:59888
allowed ips: 192.168.60.0/24
latest handshake: 32 seconds ago
transfer: 6.97 KiB received, 6.69 KiB sent
persistent keepalive: every 25 seconds
interface: wg2
public key: xxxx
private key: (hidden)
listening port: 44418
peer: xxx
preshared key: (hidden)
endpoint: 87.106.80.244:51820
allowed ips: 0.0.0.0/0, ::/0
latest handshake: 28 seconds ago
transfer: 5.12 KiB received, 5.36 KiB sent
interface: wg1
public key: xxxx
private key: (hidden)
listening port: 51823
peer: xxx
allowed ips: 192.168.13.2/32
peer: xxx
allowed ips: 192.168.13.3/32
persistent keepalive: every 25 seconds
Thank you for each help and advice!