My service that depends on the host's primary IP address, and that service fails to start if that address is not configured on the host.
But I need to use a static IP all the time, regardless of whether the network cable is plugged in。When using NetworkManager to manage the network,Is there any way to make NIC bring up static IP at startup with NO CARRIER。
LIKE THIS:
Code: Select all
5: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 00:80:64:03:01:03 brd ff:ff:ff:ff:ff:ff
6: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 00:80:64:03:01:04 brd ff:ff:ff:ff:ff:ff
inet 20.20.20.20/24 scope global enp4s0
Although I can modify rc.local ,add ip addr add x.x.x.x dev xx to Bring IP UP ...
Code: Select all
6: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 00:80:64:03:01:04 brd ff:ff:ff:ff:ff:ff
inet 20.20.20.20/24 scope global enp4s0
valid_lft forever preferred_lft foreve