- 积分
- 27
贡献148
飞刀44 FD
注册时间2021-6-28
在线时间4 小时
|
楼主 |
发表于 2022-2-18 14:19:31
|
显示全部楼层
您好,我按照您的提示设置了,但重启之后,还是没有固定IP地址,是不是我哪里设置不对
root@localhost:~# cd /etc/systemd/network/
root@localhost:/etc/systemd/network# ls
eth0.network fm1-mac1.network fm1-mac6.network
root@localhost:/etc/systemd/network# cat fm1-mac6.network
[Match]
Name=fm1-mac6
KernelCommandLine=!root=/dev/nfs
[Network]
#DHCP=yes
Address=192.168.10.9/24
Gateway=192.168.10.1
root@localhost:/etc/systemd/network# ifconfig
fm1-mac1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether da:b9:de:42:04:3f txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x1ae0000-1ae0fff
fm1-mac6: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 2e:e9:b0:b7:61:bc txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x1aea000-1aeafff
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0 |
|