码迷,mamicode.com
首页 > 移动开发 > 详细

MTK工程WAN口无法联通问题

时间:2015-07-10 11:11:12      阅读:342      评论:0      收藏:0      [点我收藏+]

标签:

开发板网口的配置在/etc/config/network文件里。
文件初始配置是这样的:
  1. root@OpenWrt:/# 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. root@OpenWrt:/# 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. root@OpenWrt:/# 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.@6relayd[0]=6relayd
  191. ucitrack.@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. root@OpenWrt:/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. root@OpenWrt:/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. root@OpenWrt:/# 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. root@OpenWrt:/# 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. root@OpenWrt:/# 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.@6relayd[0]=6relayd
  222. ucitrack.@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. root@OpenWrt:/# 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 将此选项取消再次编译即可




















MTK工程WAN口无法联通问题

标签:

原文地址:http://www.cnblogs.com/eager7/p/4634959.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!