开发板网口的配置在/etc/config/network文件里。
文件初始配置是这样的:
[email protected]:/# 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 globals ‘globals‘
option ula_prefix ‘fd79:7d0c:2266::/48‘
config interface ‘lan‘
option ifname ‘eth0.1‘
option force_link ‘1‘
option type ‘bridge‘
option proto ‘static‘
option ipaddr ‘192.168.1.1‘
option netmask ‘255.255.255.0‘
option ip6assign ‘60‘
config interface ‘wan‘
option ifname ‘eth0.2‘
option proto ‘dhcp‘
option macaddr ‘:‘
config interface ‘wan6‘
option ifname ‘@wan‘
option proto ‘dhcpv6‘
配置中LAN口名称是eth0.1,WAN口名称为eth0.2。这两个名称是通过VLAN技术虚拟出来的。
ifconfig的结果如下:
[email protected]:/# ifconfig
br-lan Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ced2:9bff:fe35:1b2d/64 Scope:Link
inet6 addr: fd79:7d0c:2266::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:146 errors:0 dropped:0 overruns:0 frame:0
TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14174 (13.8 KiB) TX bytes:21835 (21.3 KiB)
eth0 Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
inet6 addr: fe80::ced2:9bff:fe35:1b2d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:148 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:24257 (23.6 KiB)
Interrupt:3
eth0.1 Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:11361 (11.0 KiB)
eth0.2 Link encap:Ethernet HWaddr CC:D2:9B:35:1B:2D
inet6 addr: fe80::ced2:9bff:fe35:1b2d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:12448 (12.1 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:674 errors:0 dropped:0 overruns:0 frame:0
TX packets:674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:45792 (44.7 KiB) TX bytes:45792 (44.7 KiB)
ra0 Link encap:Ethernet HWaddr CC:D2:9B:F5:EE:30
inet6 addr: fe80::ced2:9bff:fef5:ee30/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:154 errors:0 dropped:0 overruns:0 frame:0
TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19927 (19.4 KiB) TX bytes:19357 (18.9 KiB)
Interrupt:4
uci的查看结果:
[email protected]:/# uci show
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded=1
dhcp.@dnsmasq[0].boguspriv=1
dhcp.@dnsmasq[0].filterwin2k=0
dhcp.@dnsmasq[0].localise_queries=1
dhcp.@dnsmasq[0].rebind_protection=1
dhcp.@dnsmasq[0].rebind_localhost=1
dhcp.@dnsmasq[0].local=/lan/
dhcp.@dnsmasq[0].domain=lan
dhcp.@dnsmasq[0].expandhosts=1
dhcp.@dnsmasq[0].nonegcache=0
dhcp.@dnsmasq[0].authoritative=1
dhcp.@dnsmasq[0].readethers=1
dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
dhcp.lan=dhcp
dhcp.lan.interface=lan
dhcp.lan.start=100
dhcp.lan.limit=150
dhcp.lan.leasetime=12h
dhcp.lan.dhcpv6=server
dhcp.lan.ra=server
dhcp.wan=dhcp
dhcp.wan.interface=wan
dhcp.wan.ignore=1
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp=0
dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
dropbear.@dropbear[0]=dropbear
dropbear.@dropbear[0].PasswordAuth=on
dropbear.@dropbear[0].RootPasswordAuth=on
dropbear.@dropbear[0].Port=22
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=lan
firewall.@zone[0].network=lan
firewall.@zone[0].input=ACCEPT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=ACCEPT
firewall.@zone[1]=zone
firewall.@zone[1].name=wan
firewall.@zone[1].network=wan wan6
firewall.@zone[1].input=REJECT
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].masq=1
firewall.@zone[1].mtu_fix=1
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src=lan
firewall.@forwarding[0].dest=wan
firewall.@rule[0]=rule
firewall.@rule[0].name=Allow-DHCP-Renew
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].name=Allow-Ping
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=ACCEPT
firewall.@rule[2]=rule
firewall.@rule[2].name=Allow-DHCPv6
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].name=Allow-ICMPv6-Input
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
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
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].name=Allow-ICMPv6-Forward
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
fstab.@global[0]=global
fstab.@global[0].anon_swap=0
fstab.@global[0].anon_mount=0
fstab.@global[0].auto_swap=1
fstab.@global[0].auto_mount=1
fstab.@global[0].delay_root=5
fstab.@global[0].check_fs=0
luci.main=core
luci.main.lang=auto
luci.main.mediaurlbase=/luci-static/openwrt.org
luci.main.resourcebase=/luci-static/resources
luci.flash_keep=extern
luci.flash_keep.uci=/etc/config/
luci.flash_keep.dropbear=/etc/dropbear/
luci.flash_keep.openvpn=/etc/openvpn/
luci.flash_keep.passwd=/etc/passwd
luci.flash_keep.opkg=/etc/opkg.conf
luci.flash_keep.firewall=/etc/firewall.user
luci.flash_keep.uploads=/lib/uci/upload/
luci.languages=internal
luci.languages.en=English
luci.sauth=internal
luci.sauth.sessionpath=/tmp/luci-sessions
luci.sauth.sessiontime=3600
luci.ccache=internal
luci.ccache.enable=1
luci.themes=internal
luci.themes.Bootstrap=/luci-static/bootstrap
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.globals=globals
network.globals.ula_prefix=fd79:7d0c:2266::/48
network.lan=interface
network.lan.ifname=eth0.1
network.lan.force_link=1
network.lan.type=bridge
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan.ip6assign=60
network.wan=interface
network.wan.ifname=eth0.2
network.wan.proto=dhcp
network.wan.macaddr=:
network.wan6=interface
network.wan6.ifname=@wan
network.wan6.proto=dhcpv6
system.@system[0]=system
system.@system[0].hostname=OpenWrt
system.@system[0].timezone=UTC
system.ntp=timeserver
system.ntp.server=0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org
system.ntp.enabled=1
system.ntp.enable_server=0
ucitrack.@network[0]=network
ucitrack.@network[0].init=network
ucitrack.@network[0].affects=dhcp radvd
ucitrack.@wireless[0]=wireless
ucitrack.@wireless[0].affects=network
ucitrack.@firewall[0]=firewall
ucitrack.@firewall[0].init=firewall
ucitrack.@firewall[0].affects=luci-splash qos miniupnpd
ucitrack.@olsr[0]=olsr
ucitrack.@olsr[0].init=olsrd
ucitrack.@dhcp[0]=dhcp
ucitrack.@dhcp[0].init=dnsmasq
ucitrack.@dropbear[0]=dropbear
ucitrack.@dropbear[0].init=dropbear
ucitrack.@httpd[0]=httpd
ucitrack.@httpd[0].init=httpd
ucitrack.@fstab[0]=fstab
ucitrack.@fstab[0].init=fstab
ucitrack.@qos[0]=qos
ucitrack.@qos[0].init=qos
ucitrack.@system[0]=system
ucitrack.@system[0].init=led
ucitrack.@system[0].affects=luci_statistics
ucitrack.@luci_splash[0]=luci_splash
ucitrack.@luci_splash[0].init=luci_splash
ucitrack.@upnpd[0]=upnpd
ucitrack.@upnpd[0].init=miniupnpd
ucitrack.@ntpclient[0]=ntpclient
ucitrack.@ntpclient[0].init=ntpclient
ucitrack.@samba[0]=samba
ucitrack.@samba[0].init=samba
ucitrack.@tinyproxy[0]=tinyproxy
ucitrack.@tinyproxy[0].init=tinyproxy
ucitrack[email protected]6relayd[0]=6relayd
ucitrack[email protected]6relayd[0].init=6relayd
uhttpd.main=uhttpd
uhttpd.main.listen_http=0.0.0.0:80 [::]:80
uhttpd.main.listen_https=0.0.0.0:443 [::]:443
uhttpd.main.home=/www
uhttpd.main.rfc1918_filter=1
uhttpd.main.max_requests=3
uhttpd.main.max_connections=100
uhttpd.main.cert=/etc/uhttpd.crt
uhttpd.main.key=/etc/uhttpd.key
uhttpd.main.cgi_prefix=/cgi-bin
uhttpd.main.script_timeout=60
uhttpd.main.network_timeout=30
uhttpd.main.http_keepalive=20
uhttpd.main.tcp_keepalive=1
uhttpd.main.ubus_prefix=/ubus
uhttpd.px5g=cert
uhttpd.px5g.days=730
uhttpd.px5g.bits=1024
uhttpd.px5g.country=DE
uhttpd.px5g.state=Berlin
uhttpd.px5g.location=Berlin
uhttpd.px5g.commonname=OpenWrt
wireless.mt7620=wifi-device
wireless.mt7620.type=mt7620
wireless.mt7620.vendor=ralink
wireless.mt7620.band=2.4G
wireless.mt7620.channel=0
wireless.mt7620.auotch=2
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=mt7620
wireless.@wifi-iface[0].ifname=ra0
wireless.@wifi-iface[0].network=lan
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].ssid=OpenWrt-mt7620
wireless.@wifi-iface[0].encryption=psk2
wireless.@wifi-iface[0].key=12345678
wireless.@wifi-iface[0].preauth=0
route打印:
[email protected]:/etc/config# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
[email protected]:/etc# arp -a
IP address HW type Flags HW address Mask Device
192.168.1.103 0x1 0x2 e8:4e:06:0a:11:bd * br-lan
然后看一个可以正常使用的版本的信息:
network
[email protected]:/# 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 globals ‘globals‘
option ula_prefix ‘fd53:0a38:5ea3::/48‘
config interface ‘lan‘
option ifname ‘eth0.1‘
option force_link ‘1‘
option type ‘bridge‘
option proto ‘static‘
option ipaddr ‘192.168.1.1‘
option netmask ‘255.255.255.0‘
option ip6assign ‘60‘
option macaddr ‘00:11:22:33:44:55‘
config interface ‘wan‘
option ifname ‘eth0.2‘
option proto ‘dhcp‘
option macaddr ‘00:11:22:33:44:56‘
config interface ‘wan6‘
option ifname ‘@wan‘
option proto ‘dhcpv6‘
ifconfig:
[email protected]:/# ifconfig
br-lan Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fd53:a38:5ea3::1/60 Scope:Global
inet6 addr: fe80::211:22ff:fe33:4455/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:9600 (9.3 KiB)
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet6 addr: fe80::211:22ff:fe33:4455/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:811 errors:0 dropped:2 overruns:0 frame:0
TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:133652 (130.5 KiB) TX bytes:17678 (17.2 KiB)
Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 00:11:22:33:44:55
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:9600 (9.3 KiB)
eth0.2 Link encap:Ethernet HWaddr 00:11:22:33:44:56
inet addr:10.128.118.18 Bcast:10.128.118.255 Mask:255.255.255.0
inet6 addr: fe80::211:22ff:fe33:4456/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:602 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:85929 (83.9 KiB) TX bytes:6211 (6.0 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:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1744 (1.7 KiB) TX bytes:1744 (1.7 KiB)
uci
[email protected]:/# uci show
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded=1
dhcp.@dnsmasq[0].boguspriv=1
dhcp.@dnsmasq[0].filterwin2k=0
dhcp.@dnsmasq[0].localise_queries=1
dhcp.@dnsmasq[0].rebind_protection=1
dhcp.@dnsmasq[0].rebind_localhost=1
dhcp.@dnsmasq[0].local=/lan/
dhcp.@dnsmasq[0].domain=lan
dhcp.@dnsmasq[0].expandhosts=1
dhcp.@dnsmasq[0].nonegcache=0
dhcp.@dnsmasq[0].authoritative=1
dhcp.@dnsmasq[0].readethers=1
dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
dhcp.lan=dhcp
dhcp.lan.interface=lan
dhcp.lan.start=100
dhcp.lan.limit=150
dhcp.lan.leasetime=12h
dhcp.lan.dhcpv6=server
dhcp.lan.ra=server
dhcp.wan=dhcp
dhcp.wan.interface=wan
dhcp.wan.ignore=1
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp=0
dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
dropbear.@dropbear[0]=dropbear
dropbear.@dropbear[0].PasswordAuth=on
dropbear.@dropbear[0].RootPasswordAuth=on
dropbear.@dropbear[0].Port=22
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=lan
firewall.@zone[0].network=lan
firewall.@zone[0].input=ACCEPT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=ACCEPT
firewall.@zone[1]=zone
firewall.@zone[1].name=wan
firewall.@zone[1].network=wan wan6
firewall.@zone[1].input=REJECT
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].masq=1
firewall.@zone[1].mtu_fix=1
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src=lan
firewall.@forwarding[0].dest=wan
firewall.@rule[0]=rule
firewall.@rule[0].name=Allow-DHCP-Renew
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].name=Allow-Ping
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=ACCEPT
firewall.@rule[2]=rule
firewall.@rule[2].name=Allow-DHCPv6
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].name=Allow-ICMPv6-Input
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
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
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].name=Allow-ICMPv6-Forward
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
luci.main=core
luci.main.lang=auto
luci.main.mediaurlbase=/luci-static/openwrt.org
luci.main.resourcebase=/luci-static/resources
luci.flash_keep=extern
luci.flash_keep.uci=/etc/config/
luci.flash_keep.dropbear=/etc/dropbear/
luci.flash_keep.openvpn=/etc/openvpn/
luci.flash_keep.passwd=/etc/passwd
luci.flash_keep.opkg=/etc/opkg.conf
luci.flash_keep.firewall=/etc/firewall.user
luci.flash_keep.uploads=/lib/uci/upload/
luci.languages=internal
luci.languages.en=English
luci.sauth=internal
luci.sauth.sessionpath=/tmp/luci-sessions
luci.sauth.sessiontime=3600
luci.ccache=internal
luci.ccache.enable=1
luci.themes=internal
luci.themes.Bootstrap=/luci-static/bootstrap
luci.themes.OpenWrt=/luci-static/openwrt.org
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.globals=globals
network.globals.ula_prefix=fd53:0a38:5ea3::/48
network.lan=interface
network.lan.ifname=eth0.1
network.lan.force_link=1
network.lan.type=bridge
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan.ip6assign=60
network.lan.macaddr=00:11:22:33:44:55
network.wan=interface
network.wan.ifname=eth0.2
network.wan.proto=dhcp
network.wan.macaddr=00:11:22:33:44:56
network.wan6=interface
network.wan6.ifname=@wan
network.wan6.proto=dhcpv6
radvd.@interface[0]=interface
radvd.@interface[0].interface=lan
radvd.@interface[0].AdvSendAdvert=1
radvd.@interface[0].ignore=0
radvd.@interface[0].IgnoreIfMissing=1
radvd.@interface[0].AdvSourceLLAddress=1
radvd.@interface[0].AdvDefaultPreference=medium
radvd.@route[0]=route
radvd.@route[0].interface=lan
radvd.@route[0].ignore=0
radvd.@route[0].AdvRouteLifetime=3600
radvd.@route[0].AdvRoutePreference=medium
radvd.@route[0].prefix=fd04:bd3:80e8:2::/64
radvd.@rdnss[0]=rdnss
radvd.@rdnss[0].interface=lan
radvd.@rdnss[0].addr=
radvd.@rdnss[0].ignore=1
radvd.@dnssl[0]=dnssl
radvd.@dnssl[0].interface=lan
radvd.@dnssl[0].suffix=
radvd.@dnssl[0].ignore=1
radvd.@prefix[0]=prefix
radvd.@prefix[0].ignore=0
radvd.@prefix[0].interface=lan
radvd.@prefix[0].AdvOnLink=1
radvd.@prefix[0].AdvAutonomous=1
radvd.@prefix[0].prefix=fd04:bd3:80e8:1::/64
radvd.@prefix[0].AdvRouterAddr=1
system.@system[0]=system
system.@system[0].hostname=OpenWrt
system.@system[0].timezone=UTC
system.ntp=timeserver
system.ntp.server=0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org
system.ntp.enabled=1
system.ntp.enable_server=0
system.led_power=led
system.led_power.name=power
system.led_power.sysfs=buffalo:green:power
system.led_power.default=1
system.led_router=led
system.led_router.name=router
system.led_router.sysfs=buffalo:green:router
system.led_router.default=1
ucitrack.@network[0]=network
ucitrack.@network[0].init=network
ucitrack.@network[0].affects=dhcp radvd
ucitrack.@wireless[0]=wireless
ucitrack.@wireless[0].affects=network
ucitrack.@firewall[0]=firewall
ucitrack.@firewall[0].init=firewall
ucitrack.@firewall[0].affects=luci-splash qos miniupnpd
ucitrack.@olsr[0]=olsr
ucitrack.@olsr[0].init=olsrd
ucitrack.@dhcp[0]=dhcp
ucitrack.@dhcp[0].init=dnsmasq
ucitrack.@dropbear[0]=dropbear
ucitrack.@dropbear[0].init=dropbear
ucitrack.@httpd[0]=httpd
ucitrack.@httpd[0].init=httpd
ucitrack.@fstab[0]=fstab
ucitrack.@fstab[0].init=fstab
ucitrack.@qos[0]=qos
ucitrack.@qos[0].init=qos
ucitrack.@system[0]=system
ucitrack.@system[0].init=led
ucitrack.@system[0].affects=luci_statistics
ucitrack.@luci_splash[0]=luci_splash
ucitrack.@luci_splash[0].init=luci_splash
ucitrack.@upnpd[0]=upnpd
ucitrack.@upnpd[0].init=miniupnpd
ucitrack.@ntpclient[0]=ntpclient
ucitrack.@ntpclient[0].init=ntpclient
ucitrack.@samba[0]=samba
ucitrack.@samba[0].init=samba
ucitrack.@tinyproxy[0]=tinyproxy
ucitrack.@tinyproxy[0].init=tinyproxy
ucitrack[email protected]6relayd[0]=6relayd
ucitrack[email protected]6relayd[0].init=6relayd
uhttpd.main=uhttpd
uhttpd.main.listen_http=0.0.0.0:80 [::]:80
uhttpd.main.listen_https=0.0.0.0:443 [::]:443
uhttpd.main.home=/www
uhttpd.main.rfc1918_filter=1
uhttpd.main.max_requests=3
uhttpd.main.max_connections=100
uhttpd.main.cert=/etc/uhttpd.crt
uhttpd.main.key=/etc/uhttpd.key
uhttpd.main.cgi_prefix=/cgi-bin
uhttpd.main.script_timeout=60
uhttpd.main.network_timeout=30
uhttpd.main.http_keepalive=20
uhttpd.main.tcp_keepalive=1
uhttpd.main.ubus_prefix=/ubus
uhttpd.px5g=cert
uhttpd.px5g.days=730
uhttpd.px5g.bits=1024
uhttpd.px5g.country=DE
uhttpd.px5g.state=Berlin
uhttpd.px5g.location=Berlin
uhttpd.px5g.commonname=OpenWrt
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.channel=11
wireless.radio0.hwmode=11g
wireless.radio0.path=10180000.wmac
wireless.radio0.htmode=HT20
wireless.radio0.disabled=1
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=radio0
wireless.@wifi-iface[0].network=lan
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].ssid=OpenWrt
wireless.@wifi-iface[0].encryption=none
zigbee-jip-daemon.@zigbee-jip-daemon[0]=zigbee-jip-daemon
zigbee-jip-daemon.@zigbee-jip-daemon[0].ignore=0
zigbee-jip-daemon.@zigbee-jip-daemon[0].tty=/dev/ttyUSB0
zigbee-jip-daemon.@zigbee-jip-daemon[0].baudrate=1000000
zigbee-jip-daemon.@zigbee-jip-daemon[0].interface=zb0
zigbee-jip-daemon.@zigbee-jip-daemon[0].mode=coordinator
zigbee-jip-daemon.@zigbee-jip-daemon[0].borderrouter=fd04:bd3:80e8:10::1
zigbee-jip-daemon.@zigbee-jip-daemon[0].channel=15
route
[email protected]:/# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.128.118.1 0.0.0.0 UG 0 0 0 eth0.2
10.128.118.0 * 255.255.255.0 U 0 0 0 eth0.2
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
上面的配置都不是网口无法连接的原因,原因是我们的板子使用的Port4口是千兆和百兆复用的端口,MTK软件将Port4设置成了千兆,导致无法正常连接,需要做的是将配置更改:
在OpenWRT目录下运行:
make kernel_menuconfig
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
+------------------------------------------------------------ Linux/mips 3.10.14 Kernel Configuration ------------------------------------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes |
| features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] built-in [ ] excluded <M> module < > module capable |
| |
| |
| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| | Machine selection ---> | |
| | Endianness selection (Little endian) ---> | |
| | CPU selection ---> | |
| | Kernel type ---> | |
| | General setup ---> | |
| | [*] Enable loadable module support ---> | |
| | [*] Enable the block layer ---> | |
| | Bus options (PCI, PCMCIA, EISA, ISA, TC) ---> | |
| | Executable file formats ---> | |
| | Power management options ---> | |
| | [*] Networking support ---> | |
| | Device Drivers ---> | |
| | Firmware Drivers ---> | |
| | File systems ---> | |
| | Kernel hacking ---> | |
| | Security options ---> | |
| | -*- Cryptographic API ---> | |
| | Library routines ---> | |
| | [ ] Virtualization ---> | |
| | Ralink Module ---> | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| <Select> < Exit > < Help > < Save > < Load > |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
找到Relink的模组选项---[ ] Port 4 Support 将此选项取消再次编译即可
时间: 2024-09-29 22:06:04