fedora-sysv / initscripts

📜 Scripts to bring up network interfaces and legacy utilities in Fedora.
GNU General Public License v2.0
46 stars 52 forks source link

ifdown don't run on non-up interfaces #441

Open gaoxingwang opened 2 years ago

gaoxingwang commented 2 years ago

The interface was brought up by ifup at first, then i ifconfig down the interface and modify the IP address in the ifcfg file. After restarting the network service, the interface will have a residual IP address. Because the network service script will not perform the ifdown operation on the network card in the down state, the link information remains.

Recurrence steps:

  1. Configure the static IP address for the network card through the ifcfg configuration file (192.168.1.1)
  2. Use the command ifconfig eth0 down to close the network port
  3. Modify the configuration file corresponding to the eth0 network card, and modify the static IP address (192.168.1.2)
  4. Restart the network service with the command systemctl restart network
  5. The expected result is that the IP address of the network card is 192.168.1.2. But there are actually two IPs (192.168.1.1 and 192.168.1.2)