|
一个openwrt的路由器,上级WAN口用DHCP获得上网地址192.168.28.x,本机LAN地址192.168.77.x,默认用dnsmasq做DNS及DHCPD服务器- cat /etc/config/network
- config interface 'loopback'
- option ifname 'lo'
- option proto 'static'
- option ipaddr '127.0.0.1'
- option netmask '255.0.0.0'
- config interface 'lan'
- option type 'bridge'
- option proto 'static'
- option ipaddr '192.168.77.1'
- option netmask '255.255.255.0'
- option dns '223.5.5.5'
- option _orig_ifname 'eth0 wlan0'
- option _orig_bridge 'true'
- option delegate '0'
- option ifname 'eth0 wlan0'
- config interface 'wan'
- option proto 'dhcp'
- option delegate '0'
- option _orig_ifname 'eth0'
- option _orig_bridge 'false'
- option ifname 'eth1.2'
- config switch
- option name 'switch0'
- option reset '1'
- option enable_vlan '1'
- config switch_vlan
- option device 'switch0'
- option vlan '1'
- option vid '1'
- option ports '1 2 3 5t'
- config switch_vlan
- option device 'switch0'
- option vlan '2'
- option ports '0 5t'
复制代码 上级分配地址很正常,看
- ifconfig
- br-lan Link encap:Ethernet HWaddr 00:1E:40:30:5E:6E
- inet addr:192.168.77.1 Bcast:192.168.77.255 Mask:255.255.255.0
- inet6 addr: fe80::21e:40ff:fe30:5e6e/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:1116 errors:0 dropped:0 overruns:0 frame:0
- TX packets:929 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:80902 (79.0 KiB) TX bytes:495746 (484.1 KiB)
- eth0 Link encap:Ethernet HWaddr 00:1E:40:30:5E:6E
- 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)
- Interrupt:16
- eth1 Link encap:Ethernet HWaddr 00:1E:40:30:5E:6F
- inet6 addr: fe80::21e:40ff:fe30:5e6f/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:1289 errors:0 dropped:0 overruns:0 frame:0
- TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:207494 (202.6 KiB) TX bytes:11473 (11.2 KiB)
- Interrupt:14
- eth1.2 Link encap:Ethernet HWaddr 00:1E:40:30:5E:6F
- inet addr:192.168.28.42 Bcast:192.168.28.127 Mask:255.255.255.128
- inet6 addr: fe80::21e:40ff:fe30:5e6f/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:1289 errors:0 dropped:0 overruns:0 frame:0
- TX packets:103 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:184292 (179.9 KiB) TX bytes:9665 (9.4 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:1 errors:0 dropped:0 overruns:0 frame:0
- TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1
- RX bytes:76 (76.0 B) TX bytes:76 (76.0 B)
- wlan0 Link encap:Ethernet HWaddr 00:1E:40:30:5E:70
- inet6 addr: fe80::21e:40ff:fe30:5e70/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:1115 errors:0 dropped:0 overruns:0 frame:0
- TX packets:1352 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:96506 (94.2 KiB) TX bytes:563647 (550.4 KiB)
复制代码 路由表
- route
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- default 192.168.28.126 0.0.0.0 UG 0 0 0 eth1.2
- 192.168.28.0 * 255.255.255.128 U 0 0 0 eth1.2
- 192.168.28.126 * 255.255.255.255 UH 0 0 0 eth1.2
- 192.168.77.0 * 255.255.255.0 U 0 0 0 br-lan
复制代码 在SSH上可以opkg,也可以ping通各种地址,但无线连接AP后,电脑或手机就是不通WAN,DNS服务都是正常解析的,为啥呢? |
|