我想为 eth0 接口分配一个静态 IP 地址,而不需要 DHCP 分配一个动态地址。我尝试将方法设置为手动,但这并没有帮助,我最终在接口上获得了 2 个 IP,一个是静态的,另一个是动态的。我希望使用 nmcli 在接口上只有一个静态 IP
/etc/NetworkManager/system-connections/static.nmconnection:
[connection]
id=static
uuid=5da74c14-d9da-4e15-90c9-5f37913d5610
type=ethernet
interface-name=eth0
permissions=
timestamp=1584007539
[ethernet]
mac-address-blacklist=
[ipv4]
address1=172.17.1.222/24,172.17.0.1
dns=172.17.0.221;172.17.0.220;
dns-search=
method=manual
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=ignore
ip一个:
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether dc:a6:32:3b:22:03 brd ff:ff:ff:ff:ff:ff
inet 172.17.1.222/24 brd 172.17.1.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet 172.17.12.14/16 brd 172.17.255.255 scope global dynamic noprefixroute eth0
valid_lft 602857sec preferred_lft 527257sec
inet6 fe80::dea6:32ff:fe3b:2203/64 scope link
valid_lft forever preferred_lft forever