MTK工程WAN口无法联通问题

开发板网口的配置在/etc/config/network文件里。

文件初始配置是这样的:

  1. [email protected]:/# cat /etc/config/network
  2. config interface ‘loopback‘
  3. option ifname ‘lo‘
  4. option proto ‘static‘
  5. option ipaddr ‘127.0.0.1‘
  6. option netmask ‘255.0.0.0‘
  7. config globals ‘globals‘
  8. option ula_prefix ‘fd79:7d0c:2266::/48‘
  9. config interface ‘lan‘
  10. option ifname ‘eth0.1‘
  11. option force_link ‘1‘
  12. option type ‘bridge‘
  13. option proto ‘static‘
  14. option ipaddr ‘192.168.1.1‘
  15. option netmask ‘255.255.255.0‘
  16. option ip6assign ‘60‘
  17. config interface ‘wan‘
  18. option ifname ‘eth0.2‘
  19. option proto ‘dhcp‘
  20. option macaddr ‘:‘
  21. config interface ‘wan6‘
  22. option ifname ‘@wan‘
  23. option proto ‘dhcpv6‘

配置中LAN口名称是eth0.1,WAN口名称为eth0.2。这两个名称是通过VLAN技术虚拟出来的。

ifconfig的结果如下:

  1. [email protected]:/# ifconfig
  2. br-lan Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
  3. inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
  4. inet6 addr: fe80::ced2:9bff:fe35:1b2d/64 Scope:Link
  5. inet6 addr: fd79:7d0c:2266::1/60 Scope:Global
  6. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  7. RX packets:146 errors:0 dropped:0 overruns:0 frame:0
  8. TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
  9. collisions:0 txqueuelen:0
  10. RX bytes:14174 (13.8 KiB) TX bytes:21835 (21.3 KiB)
  11. eth0 Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
  12. inet6 addr: fe80::ced2:9bff:fe35:1b2d/64 Scope:Link
  13. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  14. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  15. TX packets:148 errors:0 dropped:0 overruns:0 carrier:0
  16. collisions:0 txqueuelen:1000
  17. RX bytes:0 (0.0 B) TX bytes:24257 (23.6 KiB)
  18. Interrupt:3
  19. eth0.1 Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
  20. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  21. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  22. TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
  23. collisions:0 txqueuelen:0
  24. RX bytes:0 (0.0 B) TX bytes:11361 (11.0 KiB)
  25. eth0.2 Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
  26. inet6 addr: fe80::ced2:9bff:fe35:1b2d/64 Scope:Link
  27. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  28. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  29. TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
  30. collisions:0 txqueuelen:0
  31. RX bytes:0 (0.0 B) TX bytes:12448 (12.1 KiB)
  32. lo Link encap:Local Loopback
  33. inet addr:127.0.0.1 Mask:255.0.0.0
  34. inet6 addr: ::1/128 Scope:Host
  35. UP LOOPBACK RUNNING MTU:65536 Metric:1
  36. RX packets:674 errors:0 dropped:0 overruns:0 frame:0
  37. TX packets:674 errors:0 dropped:0 overruns:0 carrier:0
  38. collisions:0 txqueuelen:0
  39. RX bytes:45792 (44.7 KiB) TX bytes:45792 (44.7 KiB)
  40. ra0 Link encap:Ethernet HWaddr CC:D2:9B:F5:EE:30
  41. inet6 addr: fe80::ced2:9bff:fef5:ee30/64 Scope:Link
  42. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  43. RX packets:154 errors:0 dropped:0 overruns:0 frame:0
  44. TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
  45. collisions:0 txqueuelen:1000
  46. RX bytes:19927 (19.4 KiB) TX bytes:19357 (18.9 KiB)
  47. Interrupt:4

uci的查看结果:

  1. [email protected]:/# uci show
  2. dhcp.@dnsmasq[0]=dnsmasq
  3. dhcp.@dnsmasq[0].domainneeded=1
  4. dhcp.@dnsmasq[0].boguspriv=1
  5. dhcp.@dnsmasq[0].filterwin2k=0
  6. dhcp.@dnsmasq[0].localise_queries=1
  7. dhcp.@dnsmasq[0].rebind_protection=1
  8. dhcp.@dnsmasq[0].rebind_localhost=1
  9. dhcp.@dnsmasq[0].local=/lan/
  10. dhcp.@dnsmasq[0].domain=lan
  11. dhcp.@dnsmasq[0].expandhosts=1
  12. dhcp.@dnsmasq[0].nonegcache=0
  13. dhcp.@dnsmasq[0].authoritative=1
  14. dhcp.@dnsmasq[0].readethers=1
  15. dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
  16. dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
  17. dhcp.lan=dhcp
  18. dhcp.lan.interface=lan
  19. dhcp.lan.start=100
  20. dhcp.lan.limit=150
  21. dhcp.lan.leasetime=12h
  22. dhcp.lan.dhcpv6=server
  23. dhcp.lan.ra=server
  24. dhcp.wan=dhcp
  25. dhcp.wan.interface=wan
  26. dhcp.wan.ignore=1
  27. dhcp.odhcpd=odhcpd
  28. dhcp.odhcpd.maindhcp=0
  29. dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
  30. dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
  31. dropbear.@dropbear[0]=dropbear
  32. dropbear.@dropbear[0].PasswordAuth=on
  33. dropbear.@dropbear[0].RootPasswordAuth=on
  34. dropbear.@dropbear[0].Port=22
  35. firewall.@defaults[0]=defaults
  36. firewall.@defaults[0].syn_flood=1
  37. firewall.@defaults[0].input=ACCEPT
  38. firewall.@defaults[0].output=ACCEPT
  39. firewall.@defaults[0].forward=REJECT
  40. firewall.@zone[0]=zone
  41. firewall.@zone[0].name=lan
  42. firewall.@zone[0].network=lan
  43. firewall.@zone[0].input=ACCEPT
  44. firewall.@zone[0].output=ACCEPT
  45. firewall.@zone[0].forward=ACCEPT
  46. firewall.@zone[1]=zone
  47. firewall.@zone[1].name=wan
  48. firewall.@zone[1].network=wan wan6
  49. firewall.@zone[1].input=REJECT
  50. firewall.@zone[1].output=ACCEPT
  51. firewall.@zone[1].forward=REJECT
  52. firewall.@zone[1].masq=1
  53. firewall.@zone[1].mtu_fix=1
  54. firewall.@forwarding[0]=forwarding
  55. firewall.@forwarding[0].src=lan
  56. firewall.@forwarding[0].dest=wan
  57. firewall.@rule[0]=rule
  58. firewall.@rule[0].name=Allow-DHCP-Renew
  59. firewall.@rule[0].src=wan
  60. firewall.@rule[0].proto=udp
  61. firewall.@rule[0].dest_port=68
  62. firewall.@rule[0].target=ACCEPT
  63. firewall.@rule[0].family=ipv4
  64. firewall.@rule[1]=rule
  65. firewall.@rule[1].name=Allow-Ping
  66. firewall.@rule[1].src=wan
  67. firewall.@rule[1].proto=icmp
  68. firewall.@rule[1].icmp_type=echo-request
  69. firewall.@rule[1].family=ipv4
  70. firewall.@rule[1].target=ACCEPT
  71. firewall.@rule[2]=rule
  72. firewall.@rule[2].name=Allow-DHCPv6
  73. firewall.@rule[2].src=wan
  74. firewall.@rule[2].proto=udp
  75. firewall.@rule[2].src_ip=fe80::/10
  76. firewall.@rule[2].src_port=547
  77. firewall.@rule[2].dest_ip=fe80::/10
  78. firewall.@rule[2].dest_port=546
  79. firewall.@rule[2].family=ipv6
  80. firewall.@rule[2].target=ACCEPT
  81. firewall.@rule[3]=rule
  82. firewall.@rule[3].name=Allow-ICMPv6-Input
  83. firewall.@rule[3].src=wan
  84. firewall.@rule[3].proto=icmp
  85. firewall.@rule[3].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type router-solicitation neighbour-solicitation router-advertisement neighbour-advertisement
  86. firewall.@rule[3].limit=1000/sec
  87. firewall.@rule[3].family=ipv6
  88. firewall.@rule[3].target=ACCEPT
  89. firewall.@rule[4]=rule
  90. firewall.@rule[4].name=Allow-ICMPv6-Forward
  91. firewall.@rule[4].src=wan
  92. firewall.@rule[4].dest=*
  93. firewall.@rule[4].proto=icmp
  94. firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
  95. firewall.@rule[4].limit=1000/sec
  96. firewall.@rule[4].family=ipv6
  97. firewall.@rule[4].target=ACCEPT
  98. firewall.@include[0]=include
  99. firewall.@include[0].path=/etc/firewall.user
  100. fstab.@global[0]=global
  101. fstab.@global[0].anon_swap=0
  102. fstab.@global[0].anon_mount=0
  103. fstab.@global[0].auto_swap=1
  104. fstab.@global[0].auto_mount=1
  105. fstab.@global[0].delay_root=5
  106. fstab.@global[0].check_fs=0
  107. luci.main=core
  108. luci.main.lang=auto
  109. luci.main.mediaurlbase=/luci-static/openwrt.org
  110. luci.main.resourcebase=/luci-static/resources
  111. luci.flash_keep=extern
  112. luci.flash_keep.uci=/etc/config/
  113. luci.flash_keep.dropbear=/etc/dropbear/
  114. luci.flash_keep.openvpn=/etc/openvpn/
  115. luci.flash_keep.passwd=/etc/passwd
  116. luci.flash_keep.opkg=/etc/opkg.conf
  117. luci.flash_keep.firewall=/etc/firewall.user
  118. luci.flash_keep.uploads=/lib/uci/upload/
  119. luci.languages=internal
  120. luci.languages.en=English
  121. luci.sauth=internal
  122. luci.sauth.sessionpath=/tmp/luci-sessions
  123. luci.sauth.sessiontime=3600
  124. luci.ccache=internal
  125. luci.ccache.enable=1
  126. luci.themes=internal
  127. luci.themes.Bootstrap=/luci-static/bootstrap
  128. network.loopback=interface
  129. network.loopback.ifname=lo
  130. network.loopback.proto=static
  131. network.loopback.ipaddr=127.0.0.1
  132. network.loopback.netmask=255.0.0.0
  133. network.globals=globals
  134. network.globals.ula_prefix=fd79:7d0c:2266::/48
  135. network.lan=interface
  136. network.lan.ifname=eth0.1
  137. network.lan.force_link=1
  138. network.lan.type=bridge
  139. network.lan.proto=static
  140. network.lan.ipaddr=192.168.1.1
  141. network.lan.netmask=255.255.255.0
  142. network.lan.ip6assign=60
  143. network.wan=interface
  144. network.wan.ifname=eth0.2
  145. network.wan.proto=dhcp
  146. network.wan.macaddr=:
  147. network.wan6=interface
  148. network.wan6.ifname=@wan
  149. network.wan6.proto=dhcpv6
  150. system.@system[0]=system
  151. system.@system[0].hostname=OpenWrt
  152. system.@system[0].timezone=UTC
  153. system.ntp=timeserver
  154. system.ntp.server=0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org
  155. system.ntp.enabled=1
  156. system.ntp.enable_server=0
  157. ucitrack.@network[0]=network
  158. ucitrack.@network[0].init=network
  159. ucitrack.@network[0].affects=dhcp radvd
  160. ucitrack.@wireless[0]=wireless
  161. ucitrack.@wireless[0].affects=network
  162. ucitrack.@firewall[0]=firewall
  163. ucitrack.@firewall[0].init=firewall
  164. ucitrack.@firewall[0].affects=luci-splash qos miniupnpd
  165. ucitrack.@olsr[0]=olsr
  166. ucitrack.@olsr[0].init=olsrd
  167. ucitrack.@dhcp[0]=dhcp
  168. ucitrack.@dhcp[0].init=dnsmasq
  169. ucitrack.@dropbear[0]=dropbear
  170. ucitrack.@dropbear[0].init=dropbear
  171. ucitrack.@httpd[0]=httpd
  172. ucitrack.@httpd[0].init=httpd
  173. ucitrack.@fstab[0]=fstab
  174. ucitrack.@fstab[0].init=fstab
  175. ucitrack.@qos[0]=qos
  176. ucitrack.@qos[0].init=qos
  177. ucitrack.@system[0]=system
  178. ucitrack.@system[0].init=led
  179. ucitrack.@system[0].affects=luci_statistics
  180. ucitrack.@luci_splash[0]=luci_splash
  181. ucitrack.@luci_splash[0].init=luci_splash
  182. ucitrack.@upnpd[0]=upnpd
  183. ucitrack.@upnpd[0].init=miniupnpd
  184. ucitrack.@ntpclient[0]=ntpclient
  185. ucitrack.@ntpclient[0].init=ntpclient
  186. ucitrack.@samba[0]=samba
  187. ucitrack.@samba[0].init=samba
  188. ucitrack.@tinyproxy[0]=tinyproxy
  189. ucitrack.@tinyproxy[0].init=tinyproxy
  190. ucitrack[email protected]6relayd[0]=6relayd
  191. ucitrack[email protected]6relayd[0].init=6relayd
  192. uhttpd.main=uhttpd
  193. uhttpd.main.listen_http=0.0.0.0:80 [::]:80
  194. uhttpd.main.listen_https=0.0.0.0:443 [::]:443
  195. uhttpd.main.home=/www
  196. uhttpd.main.rfc1918_filter=1
  197. uhttpd.main.max_requests=3
  198. uhttpd.main.max_connections=100
  199. uhttpd.main.cert=/etc/uhttpd.crt
  200. uhttpd.main.key=/etc/uhttpd.key
  201. uhttpd.main.cgi_prefix=/cgi-bin
  202. uhttpd.main.script_timeout=60
  203. uhttpd.main.network_timeout=30
  204. uhttpd.main.http_keepalive=20
  205. uhttpd.main.tcp_keepalive=1
  206. uhttpd.main.ubus_prefix=/ubus
  207. uhttpd.px5g=cert
  208. uhttpd.px5g.days=730
  209. uhttpd.px5g.bits=1024
  210. uhttpd.px5g.country=DE
  211. uhttpd.px5g.state=Berlin
  212. uhttpd.px5g.location=Berlin
  213. uhttpd.px5g.commonname=OpenWrt
  214. wireless.mt7620=wifi-device
  215. wireless.mt7620.type=mt7620
  216. wireless.mt7620.vendor=ralink
  217. wireless.mt7620.band=2.4G
  218. wireless.mt7620.channel=0
  219. wireless.mt7620.auotch=2
  220. wireless.@wifi-iface[0]=wifi-iface
  221. wireless.@wifi-iface[0].device=mt7620
  222. wireless.@wifi-iface[0].ifname=ra0
  223. wireless.@wifi-iface[0].network=lan
  224. wireless.@wifi-iface[0].mode=ap
  225. wireless.@wifi-iface[0].ssid=OpenWrt-mt7620
  226. wireless.@wifi-iface[0].encryption=psk2
  227. wireless.@wifi-iface[0].key=12345678
  228. wireless.@wifi-iface[0].preauth=0

route打印:

  1. [email protected]:/etc/config# route
  2. Kernel IP routing table
  3. Destination Gateway Genmask Flags Metric Ref Use Iface
  4. 192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
  1. [email protected]:/etc# arp -a
  2. IP address HW type Flags HW address Mask Device
  3. 192.168.1.103 0x1 0x2 e8:4e:06:0a:11:bd * br-lan

然后看一个可以正常使用的版本的信息:

network

  1. [email protected]:/# cat /etc/config/network
  2. config interface ‘loopback‘
  3. option ifname ‘lo‘
  4. option proto ‘static‘
  5. option ipaddr ‘127.0.0.1‘
  6. option netmask ‘255.0.0.0‘
  7. config globals ‘globals‘
  8. option ula_prefix ‘fd53:0a38:5ea3::/48‘
  9. config interface ‘lan‘
  10. option ifname ‘eth0.1‘
  11. option force_link ‘1‘
  12. option type ‘bridge‘
  13. option proto ‘static‘
  14. option ipaddr ‘192.168.1.1‘
  15. option netmask ‘255.255.255.0‘
  16. option ip6assign ‘60‘
  17. option macaddr ‘00:11:22:33:44:55‘
  18. config interface ‘wan‘
  19. option ifname ‘eth0.2‘
  20. option proto ‘dhcp‘
  21. option macaddr ‘00:11:22:33:44:56‘
  22. config interface ‘wan6‘
  23. option ifname ‘@wan‘
  24. option proto ‘dhcpv6‘

ifconfig:

  1. [email protected]:/# ifconfig
  2. br-lan Link encap:Ethernet HWaddr 00:11:22:33:44:55
  3. inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
  4. inet6 addr: fd53:a38:5ea3::1/60 Scope:Global
  5. inet6 addr: fe80::211:22ff:fe33:4455/64 Scope:Link
  6. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  7. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  8. TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
  9. collisions:0 txqueuelen:0
  10. RX bytes:0 (0.0 B) TX bytes:9600 (9.3 KiB)
  11. eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
  12. inet6 addr: fe80::211:22ff:fe33:4455/64 Scope:Link
  13. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  14. RX packets:811 errors:0 dropped:2 overruns:0 frame:0
  15. TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
  16. collisions:0 txqueuelen:1000
  17. RX bytes:133652 (130.5 KiB) TX bytes:17678 (17.2 KiB)
  18. Interrupt:5
  19. eth0.1 Link encap:Ethernet HWaddr 00:11:22:33:44:55
  20. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  21. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  22. TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
  23. collisions:0 txqueuelen:0
  24. RX bytes:0 (0.0 B) TX bytes:9600 (9.3 KiB)
  25. eth0.2 Link encap:Ethernet HWaddr 00:11:22:33:44:56
  26. inet addr:10.128.118.18 Bcast:10.128.118.255 Mask:255.255.255.0
  27. inet6 addr: fe80::211:22ff:fe33:4456/64 Scope:Link
  28. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  29. RX packets:602 errors:0 dropped:0 overruns:0 frame:0
  30. TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
  31. collisions:0 txqueuelen:0
  32. RX bytes:85929 (83.9 KiB) TX bytes:6211 (6.0 KiB)
  33. lo Link encap:Local Loopback
  34. inet addr:127.0.0.1 Mask:255.0.0.0
  35. inet6 addr: ::1/128 Scope:Host
  36. UP LOOPBACK RUNNING MTU:65536 Metric:1
  37. RX packets:18 errors:0 dropped:0 overruns:0 frame:0
  38. TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
  39. collisions:0 txqueuelen:0
  40. RX bytes:1744 (1.7 KiB) TX bytes:1744 (1.7 KiB)

uci

  1. [email protected]:/# uci show
  2. dhcp.@dnsmasq[0]=dnsmasq
  3. dhcp.@dnsmasq[0].domainneeded=1
  4. dhcp.@dnsmasq[0].boguspriv=1
  5. dhcp.@dnsmasq[0].filterwin2k=0
  6. dhcp.@dnsmasq[0].localise_queries=1
  7. dhcp.@dnsmasq[0].rebind_protection=1
  8. dhcp.@dnsmasq[0].rebind_localhost=1
  9. dhcp.@dnsmasq[0].local=/lan/
  10. dhcp.@dnsmasq[0].domain=lan
  11. dhcp.@dnsmasq[0].expandhosts=1
  12. dhcp.@dnsmasq[0].nonegcache=0
  13. dhcp.@dnsmasq[0].authoritative=1
  14. dhcp.@dnsmasq[0].readethers=1
  15. dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
  16. dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
  17. dhcp.lan=dhcp
  18. dhcp.lan.interface=lan
  19. dhcp.lan.start=100
  20. dhcp.lan.limit=150
  21. dhcp.lan.leasetime=12h
  22. dhcp.lan.dhcpv6=server
  23. dhcp.lan.ra=server
  24. dhcp.wan=dhcp
  25. dhcp.wan.interface=wan
  26. dhcp.wan.ignore=1
  27. dhcp.odhcpd=odhcpd
  28. dhcp.odhcpd.maindhcp=0
  29. dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
  30. dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
  31. dropbear.@dropbear[0]=dropbear
  32. dropbear.@dropbear[0].PasswordAuth=on
  33. dropbear.@dropbear[0].RootPasswordAuth=on
  34. dropbear.@dropbear[0].Port=22
  35. firewall.@defaults[0]=defaults
  36. firewall.@defaults[0].syn_flood=1
  37. firewall.@defaults[0].input=ACCEPT
  38. firewall.@defaults[0].output=ACCEPT
  39. firewall.@defaults[0].forward=REJECT
  40. firewall.@zone[0]=zone
  41. firewall.@zone[0].name=lan
  42. firewall.@zone[0].network=lan
  43. firewall.@zone[0].input=ACCEPT
  44. firewall.@zone[0].output=ACCEPT
  45. firewall.@zone[0].forward=ACCEPT
  46. firewall.@zone[1]=zone
  47. firewall.@zone[1].name=wan
  48. firewall.@zone[1].network=wan wan6
  49. firewall.@zone[1].input=REJECT
  50. firewall.@zone[1].output=ACCEPT
  51. firewall.@zone[1].forward=REJECT
  52. firewall.@zone[1].masq=1
  53. firewall.@zone[1].mtu_fix=1
  54. firewall.@forwarding[0]=forwarding
  55. firewall.@forwarding[0].src=lan
  56. firewall.@forwarding[0].dest=wan
  57. firewall.@rule[0]=rule
  58. firewall.@rule[0].name=Allow-DHCP-Renew
  59. firewall.@rule[0].src=wan
  60. firewall.@rule[0].proto=udp
  61. firewall.@rule[0].dest_port=68
  62. firewall.@rule[0].target=ACCEPT
  63. firewall.@rule[0].family=ipv4
  64. firewall.@rule[1]=rule
  65. firewall.@rule[1].name=Allow-Ping
  66. firewall.@rule[1].src=wan
  67. firewall.@rule[1].proto=icmp
  68. firewall.@rule[1].icmp_type=echo-request
  69. firewall.@rule[1].family=ipv4
  70. firewall.@rule[1].target=ACCEPT
  71. firewall.@rule[2]=rule
  72. firewall.@rule[2].name=Allow-DHCPv6
  73. firewall.@rule[2].src=wan
  74. firewall.@rule[2].proto=udp
  75. firewall.@rule[2].src_ip=fe80::/10
  76. firewall.@rule[2].src_port=547
  77. firewall.@rule[2].dest_ip=fe80::/10
  78. firewall.@rule[2].dest_port=546
  79. firewall.@rule[2].family=ipv6
  80. firewall.@rule[2].target=ACCEPT
  81. firewall.@rule[3]=rule
  82. firewall.@rule[3].name=Allow-ICMPv6-Input
  83. firewall.@rule[3].src=wan
  84. firewall.@rule[3].proto=icmp
  85. firewall.@rule[3].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type router-solicitation neighbour-solicitation router-advertisement neighbour-advertisement
  86. firewall.@rule[3].limit=1000/sec
  87. firewall.@rule[3].family=ipv6
  88. firewall.@rule[3].target=ACCEPT
  89. firewall.@rule[4]=rule
  90. firewall.@rule[4].name=Allow-ICMPv6-Forward
  91. firewall.@rule[4].src=wan
  92. firewall.@rule[4].dest=*
  93. firewall.@rule[4].proto=icmp
  94. firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
  95. firewall.@rule[4].limit=1000/sec
  96. firewall.@rule[4].family=ipv6
  97. firewall.@rule[4].target=ACCEPT
  98. firewall.@include[0]=include
  99. firewall.@include[0].path=/etc/firewall.user
  100. luci.main=core
  101. luci.main.lang=auto
  102. luci.main.mediaurlbase=/luci-static/openwrt.org
  103. luci.main.resourcebase=/luci-static/resources
  104. luci.flash_keep=extern
  105. luci.flash_keep.uci=/etc/config/
  106. luci.flash_keep.dropbear=/etc/dropbear/
  107. luci.flash_keep.openvpn=/etc/openvpn/
  108. luci.flash_keep.passwd=/etc/passwd
  109. luci.flash_keep.opkg=/etc/opkg.conf
  110. luci.flash_keep.firewall=/etc/firewall.user
  111. luci.flash_keep.uploads=/lib/uci/upload/
  112. luci.languages=internal
  113. luci.languages.en=English
  114. luci.sauth=internal
  115. luci.sauth.sessionpath=/tmp/luci-sessions
  116. luci.sauth.sessiontime=3600
  117. luci.ccache=internal
  118. luci.ccache.enable=1
  119. luci.themes=internal
  120. luci.themes.Bootstrap=/luci-static/bootstrap
  121. luci.themes.OpenWrt=/luci-static/openwrt.org
  122. network.loopback=interface
  123. network.loopback.ifname=lo
  124. network.loopback.proto=static
  125. network.loopback.ipaddr=127.0.0.1
  126. network.loopback.netmask=255.0.0.0
  127. network.globals=globals
  128. network.globals.ula_prefix=fd53:0a38:5ea3::/48
  129. network.lan=interface
  130. network.lan.ifname=eth0.1
  131. network.lan.force_link=1
  132. network.lan.type=bridge
  133. network.lan.proto=static
  134. network.lan.ipaddr=192.168.1.1
  135. network.lan.netmask=255.255.255.0
  136. network.lan.ip6assign=60
  137. network.lan.macaddr=00:11:22:33:44:55
  138. network.wan=interface
  139. network.wan.ifname=eth0.2
  140. network.wan.proto=dhcp
  141. network.wan.macaddr=00:11:22:33:44:56
  142. network.wan6=interface
  143. network.wan6.ifname=@wan
  144. network.wan6.proto=dhcpv6
  145. radvd.@interface[0]=interface
  146. radvd.@interface[0].interface=lan
  147. radvd.@interface[0].AdvSendAdvert=1
  148. radvd.@interface[0].ignore=0
  149. radvd.@interface[0].IgnoreIfMissing=1
  150. radvd.@interface[0].AdvSourceLLAddress=1
  151. radvd.@interface[0].AdvDefaultPreference=medium
  152. radvd.@route[0]=route
  153. radvd.@route[0].interface=lan
  154. radvd.@route[0].ignore=0
  155. radvd.@route[0].AdvRouteLifetime=3600
  156. radvd.@route[0].AdvRoutePreference=medium
  157. radvd.@route[0].prefix=fd04:bd3:80e8:2::/64
  158. radvd.@rdnss[0]=rdnss
  159. radvd.@rdnss[0].interface=lan
  160. radvd.@rdnss[0].addr=
  161. radvd.@rdnss[0].ignore=1
  162. radvd.@dnssl[0]=dnssl
  163. radvd.@dnssl[0].interface=lan
  164. radvd.@dnssl[0].suffix=
  165. radvd.@dnssl[0].ignore=1
  166. radvd.@prefix[0]=prefix
  167. radvd.@prefix[0].ignore=0
  168. radvd.@prefix[0].interface=lan
  169. radvd.@prefix[0].AdvOnLink=1
  170. radvd.@prefix[0].AdvAutonomous=1
  171. radvd.@prefix[0].prefix=fd04:bd3:80e8:1::/64
  172. radvd.@prefix[0].AdvRouterAddr=1
  173. system.@system[0]=system
  174. system.@system[0].hostname=OpenWrt
  175. system.@system[0].timezone=UTC
  176. system.ntp=timeserver
  177. system.ntp.server=0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org
  178. system.ntp.enabled=1
  179. system.ntp.enable_server=0
  180. system.led_power=led
  181. system.led_power.name=power
  182. system.led_power.sysfs=buffalo:green:power
  183. system.led_power.default=1
  184. system.led_router=led
  185. system.led_router.name=router
  186. system.led_router.sysfs=buffalo:green:router
  187. system.led_router.default=1
  188. ucitrack.@network[0]=network
  189. ucitrack.@network[0].init=network
  190. ucitrack.@network[0].affects=dhcp radvd
  191. ucitrack.@wireless[0]=wireless
  192. ucitrack.@wireless[0].affects=network
  193. ucitrack.@firewall[0]=firewall
  194. ucitrack.@firewall[0].init=firewall
  195. ucitrack.@firewall[0].affects=luci-splash qos miniupnpd
  196. ucitrack.@olsr[0]=olsr
  197. ucitrack.@olsr[0].init=olsrd
  198. ucitrack.@dhcp[0]=dhcp
  199. ucitrack.@dhcp[0].init=dnsmasq
  200. ucitrack.@dropbear[0]=dropbear
  201. ucitrack.@dropbear[0].init=dropbear
  202. ucitrack.@httpd[0]=httpd
  203. ucitrack.@httpd[0].init=httpd
  204. ucitrack.@fstab[0]=fstab
  205. ucitrack.@fstab[0].init=fstab
  206. ucitrack.@qos[0]=qos
  207. ucitrack.@qos[0].init=qos
  208. ucitrack.@system[0]=system
  209. ucitrack.@system[0].init=led
  210. ucitrack.@system[0].affects=luci_statistics
  211. ucitrack.@luci_splash[0]=luci_splash
  212. ucitrack.@luci_splash[0].init=luci_splash
  213. ucitrack.@upnpd[0]=upnpd
  214. ucitrack.@upnpd[0].init=miniupnpd
  215. ucitrack.@ntpclient[0]=ntpclient
  216. ucitrack.@ntpclient[0].init=ntpclient
  217. ucitrack.@samba[0]=samba
  218. ucitrack.@samba[0].init=samba
  219. ucitrack.@tinyproxy[0]=tinyproxy
  220. ucitrack.@tinyproxy[0].init=tinyproxy
  221. ucitrack[email protected]6relayd[0]=6relayd
  222. ucitrack[email protected]6relayd[0].init=6relayd
  223. uhttpd.main=uhttpd
  224. uhttpd.main.listen_http=0.0.0.0:80 [::]:80
  225. uhttpd.main.listen_https=0.0.0.0:443 [::]:443
  226. uhttpd.main.home=/www
  227. uhttpd.main.rfc1918_filter=1
  228. uhttpd.main.max_requests=3
  229. uhttpd.main.max_connections=100
  230. uhttpd.main.cert=/etc/uhttpd.crt
  231. uhttpd.main.key=/etc/uhttpd.key
  232. uhttpd.main.cgi_prefix=/cgi-bin
  233. uhttpd.main.script_timeout=60
  234. uhttpd.main.network_timeout=30
  235. uhttpd.main.http_keepalive=20
  236. uhttpd.main.tcp_keepalive=1
  237. uhttpd.main.ubus_prefix=/ubus
  238. uhttpd.px5g=cert
  239. uhttpd.px5g.days=730
  240. uhttpd.px5g.bits=1024
  241. uhttpd.px5g.country=DE
  242. uhttpd.px5g.state=Berlin
  243. uhttpd.px5g.location=Berlin
  244. uhttpd.px5g.commonname=OpenWrt
  245. wireless.radio0=wifi-device
  246. wireless.radio0.type=mac80211
  247. wireless.radio0.channel=11
  248. wireless.radio0.hwmode=11g
  249. wireless.radio0.path=10180000.wmac
  250. wireless.radio0.htmode=HT20
  251. wireless.radio0.disabled=1
  252. wireless.@wifi-iface[0]=wifi-iface
  253. wireless.@wifi-iface[0].device=radio0
  254. wireless.@wifi-iface[0].network=lan
  255. wireless.@wifi-iface[0].mode=ap
  256. wireless.@wifi-iface[0].ssid=OpenWrt
  257. wireless.@wifi-iface[0].encryption=none
  258. zigbee-jip-daemon.@zigbee-jip-daemon[0]=zigbee-jip-daemon
  259. zigbee-jip-daemon.@zigbee-jip-daemon[0].ignore=0
  260. zigbee-jip-daemon.@zigbee-jip-daemon[0].tty=/dev/ttyUSB0
  261. zigbee-jip-daemon.@zigbee-jip-daemon[0].baudrate=1000000
  262. zigbee-jip-daemon.@zigbee-jip-daemon[0].interface=zb0
  263. zigbee-jip-daemon.@zigbee-jip-daemon[0].mode=coordinator
  264. zigbee-jip-daemon.@zigbee-jip-daemon[0].borderrouter=fd04:bd3:80e8:10::1
  265. zigbee-jip-daemon.@zigbee-jip-daemon[0].channel=15

route

  1. [email protected]:/# route
  2. Kernel IP routing table
  3. Destination Gateway Genmask Flags Metric Ref Use Iface
  4. default 10.128.118.1 0.0.0.0 UG 0 0 0 eth0.2
  5. 10.128.118.0 * 255.255.255.0 U 0 0 0 eth0.2
  6. 192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan

上面的配置都不是网口无法连接的原因,原因是我们的板子使用的Port4口是千兆和百兆复用的端口,MTK软件将Port4设置成了千兆,导致无法正常连接,需要做的是将配置更改:

在OpenWRT目录下运行:

make kernel_menuconfig

  1. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. +------------------------------------------------------------ Linux/mips 3.10.14 Kernel Configuration ------------------------------------------------------------+
  3. | Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
  4. | features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] built-in [ ] excluded <M> module < > module capable |
  5. | |
  6. | |
  7. | +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
  8. | | Machine selection ---> | |
  9. | | Endianness selection (Little endian) ---> | |
  10. | | CPU selection ---> | |
  11. | | Kernel type ---> | |
  12. | | General setup ---> | |
  13. | | [*] Enable loadable module support ---> | |
  14. | | [*] Enable the block layer ---> | |
  15. | | Bus options (PCI, PCMCIA, EISA, ISA, TC) ---> | |
  16. | | Executable file formats ---> | |
  17. | | Power management options ---> | |
  18. | | [*] Networking support ---> | |
  19. | | Device Drivers ---> | |
  20. | | Firmware Drivers ---> | |
  21. | | File systems ---> | |
  22. | | Kernel hacking ---> | |
  23. | | Security options ---> | |
  24. | | -*- Cryptographic API ---> | |
  25. | | Library routines ---> | |
  26. | | [ ] Virtualization ---> | |
  27. | | Ralink Module ---> | |
  28. | | | |
  29. | | | |
  30. | | | |
  31. | | | |
  32. | | | |
  33. | | | |
  34. | | | |
  35. | | | |
  36. | | | |
  37. | | | |
  38. | | | |
  39. | +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
  40. +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | <Select> < Exit > < Help > < Save > < Load > |
  42. +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+

找到Relink的模组选项---[ ] Port 4 Support 将此选项取消再次编译即可

来自为知笔记(Wiz)

时间: 2024-09-29 22:06:04

MTK工程WAN口无法联通问题的相关文章

关于电信宽带wan口地址变成100.64网段的问题解决

由于之前笔者一直在使用动态域名连接公司vpn.今天在连接vpn的时候总是失败,因动态域名及vpn配置都从未更改过. 于是首先排查动态域名,是否已更新为公司宽带对外的IP.这里笔者先通过nslookup对动态域名进行解析,然后再进入ip138查看公司的对外IP,结果均为118.114.96.87. 笔者再进入公司核心路由器,发现路由器wan口的地址居然与刚才ip138上看到的IP地址不一样.路由器的wan口地址如下图所示: 但通过ip138查询这个100.64.53.57这个IP,却显示的地址为美

wan口mac=lan口mac加一,wlan是lan口mac加二

(1)路由器有两个mac地址,一个用于外网(wan),一个用于内网(wlan和lan): (2)一般路由器上面或者配置路由器的网页上面只标注外网的mac地址: (3)内网的mac地址和外网mac地址一般只有几位不同(甚至连续,也有些相差很多的例外). Dlink的默认wan口mac=lan口mac加一,wlan是lan口mac加二,在mac地址克隆功能中可以修改对广域网wlan的mac地址,理论上一个网口 LAN MAC WAN MAC 和 WLAN MAC的关系 给一个范例: 00:0C:E5

H3C ER3200双WAN口设置案例图解

方法一: 1.启用DHCP,设置好地址池(方便客户端获取到同网段IP,启用后,客户端还会是默认的192.168.1.0网段) 2.设置LAN信息,完成后,PC会与路由失去连接,重新启用网卡,即可再次登陆路由器. 3.设置WAN口参数. 4.双WAN口工作模式选择,此处笔者选择了均衡模式(WAN1 20M ,WAN2 100M). 4.设置策略路由及其它流量限制. 方法二: 1.如果先设置WAN信息,记得先断开猫的连接线(猫进来的IP是192.168.1.1,路由WAN口IP是192.168.1.

双层路由设置,WAN口和LAN口连接的方法设置

WAN口设置方法,社路由器分别为路1 和路2 1 路2的LAN口地址改为172.16.1.1,重启 2 笔记本改成172.16.1.X,然后进入设置,在里面WAN地址设置为静态地址 192.168.1.x,重启 LAN设置方法: 1 进入路2的管理界面,关闭DHCP 2 修改路2的LAN口地址,为192.168.1.X 共同点:都要改LAN口地址,但是方法不一样

路由器WAN口和LAN口详解

前一阵子做路由器的联网,由于利用了Openwrt操作系统,做起来虽然方便,但是很多原理细节都被忽略了.所以这里再来老生常谈一下wan口和lan口的区别,以及他们之间的工作原理. 首先百度一下,基本知识: 熟悉网络的朋友都知道WAN是英文Wide Area Network的首字母所写,即代表广域网:而LAN则是Local Area Network的所写,即本地(或叫局域网).那么我们不妨给路由器上的WAN口和LAN口取一个中文名称,分别是广域网端口和本地网端口.从名称中不难发现,WAN口主要用来连

routerOS做wan口的交换机扩展和带宽叠加

实验设备: 1台routeros5.24版路由器 1台思科2960交换机 2条100M电信带宽:1条下行100M 上行8M,另一条下行100M上行4M 实验目的: 叠加多条上网宽带,以增大公司用网需求.本实验中只有两条宽带,实际可能到达百条宽带接入,这时再用网卡接入就不太现实了.故用交换机扩展来增加带宽接入端口 实验步骤: 一:先做wan口交换机扩展 1.在2960上做Vlan,并加入端口,每端口一个Vlan En Conf t Vlan 2 Exit Vlan 3 Exit Inter f0/

通过路由器的IP映射来解决,两个不同IP地址的PC机之间的从LAN口到WAN口的单向通讯问题

1.问题假设: 在B机中IP地址与子网掩码都固定,网关是路由器的LAN口的IP地址,我们希望通过路由器来实现B机与A机之间的单向通讯问题,也就是说B可以ping通A且可以访问A提供的FTP站点. 2.解决方法: 下面看路由器的配置: WAN口的配置: WAN口的IP地址设置为与A机同网段的IP地址,网关为A机的IP地址. LAN口的配置: DHCP服务器关闭,禁止动态分配IP. 之后我们在B机上就可以ping到A机... 同样的也可以访问A机提供的ftp站点... 3.注意: 需要注意的是,A机

多 wan 口路由器配置

#最近一直在写这个思科,华为的交换机,下面讲一下,企业级,网吧,中小型企业用的路由器,web型(网管型) #多wan口路由器是用来做什么的? # 举个简单的例子 : 假如一个企业业务比较重要,为了防止,出现单线路故障,可能会再拉一条线, 也就是起到备份的作用,也可以起到负载均衡的作用 #其实就是,拉两条线,一条是电信的,一条是移动 //或者是一条是专线,一条是adsl  //专线的上传和下载的速度都是一样的,但是adsl的上传和下载的速度是不一样的  ----------切记      # 也就

WAN口和LAN 口有什么区别

WAN口不能够用来连接电脑. LAN(1.2.3.4)口只能够用来连接电脑. 拓展资料 路由器(Router),是连接因特网中各局域网.广域网的设备,它会根据信道的情况自动选择和设定路由,以最佳路径,按前后顺序发送信号. 路由器是互联网络的枢纽,"交通警察". 目前路由器已经广泛应用于各行各业,各种不同档次的产品已成为实现各种骨干网内部连接.骨干网间互联和骨干网与互联网互联互通业务的主力军. 路由和交换机之间的主要区别就是交换机发生在OSI参考模型第二层(数据链路层),而路由发生在第三