天天看点

After boot, why do I need to restart networking to bring my network interfaces online?

After boot, why do I need to restart networking to bring my network interfaces online?

环境

  • Red Hat Enterprise Linux
  • Manually managed network switch

问题

  • When booting a system running Red Hat Enterprise Linux, the system will be unable to connect to the network or obtain an IP address until the interface is restarted either by a ​

    ​service network restart​

    ​ or ​

    ​ifup ethX​

    ​, where X is equivalent to the number of the interface.

决议

  • Ensure that portfast mode has been enabled on the switch. If it is not, enable it - typically during the boot process the network initialization process occurs earlier than the switch will allow traffic to pass through to other hosts, and therefore fails before any network connectivity is established. With portfast mode enabled, the switch will allow traffic to flow at a faster rate.
  • To configure your switch to allow this, please refer to your switch's documentation or support organization.

诊断步骤

  • Assuming Cisco IOS, you can check from the switch the portfast mode which should have similar output:
Port      Vlan  Port-State     Cost   Priority  Fast-Start  Group-Method
--------  ----  -------------  -----  --------  ----------  ------------
 0/1      1     forwarding        19        32  disabled
      
  • In the above example, the Fast-Start section is disabled, indicating that portfast mode is currently not applied.

继续阅读