nas 多网卡重启 ethX 变化 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要把任何和邀请码有关的内容发到 NAS 节点。

邀请码相关的内容请使用 /go/in 节点。

如果没有发送到 /go/in,那么会被移动到 /go/pointless 同时账号会被降权。如果持续触发这样的移动,会导致账号被禁用。
huangya
V2EX    NAS

nas 多网卡重启 ethX 变化

  •  
  •   huangya 2023-10-03 17:30:16 +8:00 1690 次点击
    这是一个创建于 821 天前的主题,其中的信息可能已经有所发展或是发生改变。
    黑裙,有两个板载网卡,一个 pcie 网卡。pcie 网卡有时候似乎是 eth2,有时候是 eth1. 可能跟启动方式有关,看是否三 wol (网络唤醒 pcie 网卡)还是手动按电源开机。如果有人遇到过相同情况吗?

    是 eth1 的情况:

    tony@mynas:~$ ifconfig
    eth0 Link encap:Ethernet HWaddr E0:D5:5E:6E:4B:43
    inet addr:192.168.1.128 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:7053 errors:0 dropped:0 overruns:0 frame:0
    TX packets:7553 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1916255 (1.8 MiB) TX bytes:9718425 (9.2 MiB)

    eth1 Link encap:Ethernet HWaddr E0:D5:5E:6E:4B:41
    inet addr:192.168.5.129 Bcast:192.168.5.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:21388 errors:0 dropped:0 overruns:0 frame:0
    TX packets:28281 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:5024869 (4.7 MiB) TX bytes:2794752 (2.6 MiB)

    eth2 Link encap:Ethernet HWaddr 00:17:B6:00:52:11
    inet addr:192.168.5.128 Bcast:192.168.5.255 Mask:255.255.255.0
    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 memory 0xf7700000-f7720000

    是 eth2 的情况

    tony@mynas:~$ ifconfig
    eth0 Link encap:Ethernet HWaddr E0:D5:5E:6E:4B:43
    inet addr:192.168.1.128 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:1257 errors:0 dropped:0 overruns:0 frame:0
    TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:267249 (260.9 KiB) TX bytes:17483 (17.0 KiB)

    eth1 Link encap:Ethernet HWaddr E0:D5:5E:6E:4B:41
    inet addr:192.168.5.129 Bcast:192.168.5.255 Mask:255.255.255.0
    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 memory 0xf7700000-f7720000

    eth2 Link encap:Ethernet HWaddr 00:17:B6:00:52:11
    inet addr:192.168.5.128 Bcast:192.168.5.255 Mask:255.255.255.
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:8550 errors:0 dropped:0 overruns:0 frame:0
    TX packets:13761 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:2130151 (2.0 MiB) TX bytes:1334096 (1.2 MiB)

    启动参数:

    tony@mynas:~$ cat /proc/cmdline
    withefi cOnsole=ttyS0,115200n8 earlycon=uart8250,io,0x3f8,115200n8 root=/dev/md0 syno_hw_version=DS918+ netif_num=3 mac2=e0d55e6e4b41 mac3=0017b6005211 mac1=e0d55e6e4b43 sn=1910PDN027610 HddHotplug=0 syno_hdd_detect=0 vender_format_version=2 syno_hdd_powerup_seq=0
    6 条回复    2023-10-04 16:20:43 +08:00
    hefish
        1
    hefish  
       2023-10-03 17:52:06 +08:00
    看 Mac 地址,好像没变化嘛,eth0 还是 Eth0, eth2 还是 eth2
    hefish
        2
    hefish  
       2023-10-03 17:55:10 +08:00
    哦。。。是 interrupt 变化了吧。。。
    yanqiyu
        3
    yanqiyu  
       2023-10-04 04:41:56 +08:00
    ethx 这种编号本来就不保证稳定,所以会有 systemd 这类会有 enp102s0f1 这种按照 bus 种类/位置标记的排序(当然群晖不带 systemd )
    不过话说回来,不过你应该可以自己写 udev 规则匹配网卡改名,然后用自己改的名字
    huangya
        4
    huangya  
    OP
       2023-10-04 10:56:53 +08:00
    @hefish
    @yanqiyu
    多次实验,已经基本确认了,使用 wol 唤醒 pcie 网卡,pcie 网卡是 eth2. 手动按电源是 eth1. 哎,先这样 workaround,也就是尽量采用固定一种方式开机。
    busier
        5
    busier  
       2023-10-04 11:28:44 +08:00
    你这块主板也真够奇葩
    kkk9
        6
    kkk9  
       2023-10-04 16:20:43 +08:00
    eth 和网卡不是强绑定关系的,解决办法也很简单,把网卡 mac 和 ethX 手动绑定

    vi /etc/udev/rules.d/70-persistent-net.rules

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:66", NAME="eth0"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:77", NAME="eth1"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:88", NAME="eth2"

    保存重启
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2466 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 26ms UTC 07:06 PVG 15:06 LAX 23:06 JFK 02:06
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86