network配置:
config interface ‘loopback’
option ifname ‘lo’
option proto ‘static’
option ipaddr ‘127.0.0.1’
option netmask ‘255.0.0.0’
config globals ‘globals’
option ula_prefix ‘fd0c:955c:7c71::/48’
config interface ‘lan’
option type ‘bridge’
option ifname ‘eth0.1’
option proto ‘static’
option ipaddr ‘192.168.1.1’
option netmask ‘255.255.255.0’
option ip6assign ‘60’
config device ‘lan_eth0_1_dev’
option name ‘eth0.1’
option macaddr ‘56:63:bd:06:6c:27’
config interface ‘wan’
option ifname ‘eth0.2’
option proto ‘dhcp’
config interface ‘wwan’
option proto ‘dhcp’
config device ‘wan_eth0_2_dev’
option name ‘eth0.2’
option macaddr ‘56:63:bd:06:6c:28’
config interface ‘wan6’
option ifname ‘eth0.2’
option proto ‘dhcpv6’
config switch
option name ‘switch0’
option reset ‘1’
option enable_vlan ‘1’
config switch_vlan
option device ‘switch0’
option vlan ‘1’
option ports ‘1 2 3 4 6t’
config switch_vlan
option device ‘switch0’
option vlan ‘2’
option ports ‘0 6t’
wireless配置:
config wifi-device ‘radio0’
option type ‘mac80211’
option channel ‘36’
option hwmode ‘11a’
option path ‘virtual/mac80211_hwsim/hwsim0’
option htmode ‘VHT80’
option disabled ‘0’
config wifi-iface ‘default_radio0’
option device ‘radio0’
option network ‘lan’
option mode ‘ap’
option ssid ‘OpenWrt’
option encryption ‘none’
config wifi-device ‘radio1’
option type ‘mac80211’
option channel ‘auto’
option hwmode ‘11g’
option path ‘virtual/mac80211_hwsim/hwsim1’
option htmode ‘VHT80’
option disabled ‘0’
config wifi-iface ‘default_radio1’
option device ‘radio1’
option network ‘wwan’
option mode ‘sta’
option ssid ‘routerdwifi-2.4G’
option encryption ‘psk2’
option key ‘260308abc’
root@OpenWrt:/# ifconfig
br-lan Link encap:Ethernet HWaddr 56:63:BD:06:6C:27
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::5463:bdff:fe06:6c27/64 Scope:Link
inet6 addr: fd0c:955c:7c71::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1860 (1.8 KiB)
eth0 Link encap:Ethernet HWaddr 56:59:F6:21:1A:AD
inet6 addr: fe80::5459:f6ff:fe21:1aad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:45522 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:15483928 (14.7 MiB)
Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 56:63:BD:06:6C:27
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1860 (1.8 KiB)
eth0.2 Link encap:Ethernet HWaddr 56:63:BD:06:6C:28
inet6 addr: fe80::5463:bdff:fe06:6c28/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:6862 (6.7 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:15644 errors:0 dropped:0 overruns:0 frame:0
TX packets:15644 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1063792 (1.0 MiB) TX bytes:1063792 (1.0 MiB)
wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan1 Link encap:Ethernet HWaddr 02:00:00:00:01:00
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)