我的 vocore2 中没有以太网 IP 地址

我的 vocore2 中没有以太网 IP 地址

我刚刚闪现了我的沃科雷2u使用openwrt 18.06.1,并用以太网线插入网络,同时为我的手机设置无线接入点。 在此输入图像描述 AP正在工作并连接到网络,但我手机中的IP位于另一个路由器的子网中。而且我的 vocore2 没有分配 IP,所以我无法通过 ssh 访问它。用串口终端连接vocore2后,ping 8.8.8.8也失败。如何让我的vocore2从路由器获得IP并设置好网络?

    root@OpenWrt:/etc/config# ifconfig
    apcli0    Link encap:Ethernet  HWaddr BA:D8:12:07:01:71
              inet6 addr: fe80::b8d8:12ff:fe07:171/64 Scope:Link
              UP BROADCAST RUNNING 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)

    br-lan    Link encap:Ethernet  HWaddr B8:D8:12:67:01:72
              inet addr:192.168.61.1  Bcast:192.168.61.255  Mask:255.255.255.0
              inet6 addr: fd43:4277:1a20::1/60 Scope:Global
              inet6 addr: fe80::bad8:12ff:fe67:172/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:16891 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2404 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1181826 (1.1 MiB)  TX bytes:477837 (466.6 KiB)

    eth0      Link encap:Ethernet  HWaddr B8:D8:12:67:01:72
              inet6 addr: fe80::bad8:12ff:fe67:172/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2773 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:736242 (718.9 KiB)
              Interrupt:5

    eth0.1    Link encap:Ethernet  HWaddr B8:D8:12:67:01:72
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1067 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:145725 (142.3 KiB)

    eth0.2    Link encap:Ethernet  HWaddr B8:D8:12:67:01:72
              inet6 addr: fe80::bad8:12ff:fe67:172/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1692 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:577096 (563.5 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:886 errors:0 dropped:0 overruns:0 frame:0
              TX packets:886 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:64988 (63.4 KiB)  TX bytes:64988 (63.4 KiB)

    ra0       Link encap:Ethernet  HWaddr B8:D8:12:67:01:71
              inet6 addr: fe80::bad8:12ff:fe67:171/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:27199 errors:14 dropped:0 overruns:0 frame:0
              TX packets:2398 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:2189856 (2.0 MiB)  TX bytes:441570 (431.2 KiB)
              Interrupt:6

网络配置

    root@OpenWrt:/etc/config# uci show network
    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='fd43:4277:1a20::/48'
    network.lan=interface
    network.lan.type='bridge'
    network.lan.ifname='eth0.1'
    network.lan.proto='static'
    network.lan.ipaddr='192.168.61.1'
    network.lan.netmask='255.255.255.0'
    network.lan.ip6assign='60'
    network.lan_dev=device
    network.lan_dev.name='eth0.1'
    network.lan_dev.macaddr='b8:d8:12:67:01:72'
    network.wan=interface
    network.wan.ifname='eth0.2'
    network.wan.force_link='1'
    network.wan.proto='dhcp'
    network.wwan=interface
    network.wwan.ifname='apcli0'
    network.wwan.proto='dhcp'
    network.@switch[0]=switch
    network.@switch[0].name='switch0'
    network.@switch[0].reset='1'
    network.@switch[0].enable_vlan='1'
    network.@switch_vlan[0]=switch_vlan
    network.@switch_vlan[0].device='switch0'
    network.@switch_vlan[0].vlan='1'
    network.@switch_vlan[0].ports='0 2 6t'

答案1

使用以下配置修复:

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='fd15:39fa:4166::/48'
network.lan=interface
network.lan.ifname='eth0.1'
network.lan.force_link='1'
network.lan.macaddr='b8:d8:12:67:01:71'
network.lan.type='bridge'
network.lan.proto='static'
network.lan.ipaddr='192.168.61.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.wan=interface
network.wan.ifname='eth0.2'
network.wan.force_link='1'
network.wan.macaddr='b8:d8:12:67:01:72'
network.wan.proto='dhcp'
network.wan6=interface
network.wan6.ifname='eth0.2'
network.wan6.proto='dhcpv6'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device='switch0'
network.@switch_vlan[0].vlan='1'
network.@switch_vlan[0].ports='1 2 3 4 6t'
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device='switch0'
network.@switch_vlan[1].vlan='2'
network.@switch_vlan[1].ports='0 6t'

相关内容