Hello, I'm running openwrt21.02 on MT7621.
In the default configuration, the device has a wan port and a br-lan(lan1, lan2, lan3, lan4).
- Here is what I want to do:
1.1. br-lan(lan2, lan3, lan4) and wan act as a general router.
1.1.1 wan port use dhcp protocol to get an ip address from RouterA.
1.1.2 Terminals(like pc) wired to br-lan will get ip address from router.
1.1.3 Data from Terminals will be sent from wan with NAT.
1.2. Bridge lan1 port with wan.10(or wanmac0) port as br-vlan10
1.2.1 br-vlan10 has no ip address
1.2.2 Terminals(like pc) wired to lan1 should get ip address from RouterA.
1.2.3 Data from Terminals should be sent through wan.10(or wanmac0) without NAT.
- Following is my configuration:
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 packet_steering '1'
option ula_prefix 'fdf6:7da6:4e63::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config device
option type '8021q'
option ifname 'wan'
option vid '10'
option name 'wan.10'
config device
option type 'bridge'
option name 'br-vlan10'
list ports 'lan1'
list ports 'wan.10'
config interface 'vlan10'
option device 'br-vlan10'
option proto 'none'
config bridge-vlan
option device 'br-vlan10'
option vlan '10'
list ports 'lan1:u*'
list ports 'wan.10:t*'
root@OpenWrt:~#
- However, terminal connected to lan1 can't get ip address from RouterA.
Using tcpdump, I can see these:
3.1 tcpdump -i lan1 -nn --> capture ipv4 dhcp discover and ipv6 dhcp xxx from terminal
3.2 tcpdump -i br-vlan10 -nn --> capture ipv4 dhcp discover and ipv6 dhcp xxx from terminal
3.3 tcpdump -i wan.10 -nn --> no ipv4 dhcp discover, capture ipv6 dhcp xxx from terminal
3.4 On RouterA, tcpdump -i br-lan10 port 67 or port 547 -nn --> no ipv4 dhcp discover, capture ipv6 dhcp xxx from terminal