재부팅 후 네트워크 서비스를 다시 시작해야 합니다(centos 7).

재부팅 후 네트워크 서비스를 다시 시작해야 합니다(centos 7).

4포트(em1~em4) QLogic 네트워크 인터페이스가 있는 서버를 설정하고 있습니다. em3를 통해 연결되며 IP 주소는 MAC 주소를 기반으로 DHCP에 의해 자동으로 부여됩니다. 인터넷을 켠 후 인터넷에 접속할 수 없습니다. 그래서 systemctl restart network부팅할 때마다 사용해야 합니다.

시작한 후 systemctl status network때때로 다음을 제공합니다.

network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since ven. 2019-03-15 09:20:18 CET; 2min 21s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1365 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

mars 15 09:19:32 localhost.localdomain systemd[1]: Starting LSB: Bring up/down networking...
mars 15 09:19:32 localhost.localdomain network[1365]: Activation de l'interface loopback :  [  OK  ]
mars 15 09:20:18 localhost.localdomain network[1365]: Activation de l'interface em3 :  Erreur : l'activation de la connexion a échoué : La configuration IP n'a pas pu être réservée (aucun adresse disponible, délai d'expiration, etc. )
mars 15 09:20:18 localhost.localdomain network[1365]: [ÉCHOUÉ]
mars 15 09:20:18 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1
mars 15 09:20:18 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking.
mars 15 09:20:18 localhost.localdomain systemd[1]: Unit network.service entered failed state.
mars 15 09:20:18 localhost.localdomain systemd[1]: network.service failed.

분명히 네트워크가 활성화되지 않았습니다. 그러나 때로는 (분명히 무작위로) 다음을 얻을 수도 있습니다. 시작 후:

network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: active (exited) since ven. 2019-03-08 15:05:10 CET; 48s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2781 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
  Process: 3019 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)

mars 08 15:05:09 localhost.localdomain systemd[1]: Starting LSB: Bring up/down networking...
mars 08 15:05:09 localhost.localdomain network[3019]: Activation de l'interface loopback :  [  OK  ]
mars 08 15:05:09 localhost.localdomain network[3019]: Activation de l'interface em3 :  Connexion activée (chemin D-Bus actif : /org/freedesktop/NetworkManager/ActiveConnection/5)
mars 08 15:05:09 localhost.localdomain network[3019]: [  OK  ]
mars 08 15:05:10 localhost.localdomain systemd[1]: Started LSB: Bring up/down networking.

그런데 연결이 활성화된 것 같은데 네트워크에 액세스하려면 재부팅해야 합니다.

/etc/sysconfig/network-scripts/ifcfg-em3에 다음이 포함되어 있다고 추가해 보겠습니다.

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=em3
UUID=442f***************************
ONBOOT=yes
IPV6_PRIVACY=no

ONBOOT가 yes로 설정되어 있으므로 이 문제를 해결하는 방법을 모르겠습니다.

추신: /var/log/message(네트워크 관리자 줄만 포함)를 보면 시작 시간이 나와 있습니다.

 Mar 15 09:10:59 localhost NetworkManager[1148]: <info>  [1552637459.9299] ifcfg-rh: new connection /etc/sysconfig/network-scripts/ifcfg-em3 (442f*****************,"em3")
Mar 15 09:11:01 localhost NetworkManager[1148]: <info>  [1552637461.9915] manager: (em3): new Ethernet device (/org/freedesktop/NetworkManager/Devices/4)
Mar 15 09:11:01 localhost NetworkManager[1148]: <info>  [1552637461.9924] device (em3): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Mar 15 09:11:01 localhost kernel: IPv6: ADDRCONF(NETDEV_UP): em3: link is not ready
Mar 15 09:11:02 localhost kernel: bnx2x 0000:01:00.2 em3: using MSI-X  IRQs: sp 85  fp[0] 87 ... fp[7] 94
Mar 15 09:11:02 localhost kernel: bnx2x 0000:01:00.2 em3: NIC Link is Up, 1000 Mbps full duplex, Flow control: none
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.2490] device (em3): link connected
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5636] device (em3): state change: unavailable -> disconnected (reason 'none') [20 30 0]
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5657] policy: auto-activating connection 'em3'
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5668] policy: auto-activating connection 'em3'
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5682] device (em3): Activation: starting connection 'em3' (442f********************)
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5683] device (em3): disconnecting connection 'em3' for new activation request
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5683] device (em3): state change: disconnected -> deactivating (reason 'new-activation') [30 110 60]
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5691] device (em4): Activation: starting connection 'em3' (442f************************)
Mar 15 09:11:02 localhost NetworkManager[1148]: <info>  [1552637462.5702] device (em3): state change: deactivating -> disconnected (reason 'new-activation') [110 30 60]
Mar 15 09:11:02 localhost nm-dispatcher: req:2 'down' [em3]: new request (4 scripts)
Mar 15 09:11:02 localhost nm-dispatcher: req:2 'down' [em3]: start running ordered scripts...
Mar 15 09:11:30 localhost NetworkManager[1148]: <info>  [1552637490.3692] device (em4): disconnecting connection 'em3' for new activation request
Mar 15 09:11:30 localhost NetworkManager[1148]: <info>  [1552637490.3704] audit: op="connection-activate" uuid="442f*********************" name="em3" pid=1484 uid=0 result="success"
Mar 15 09:11:30 localhost NetworkManager[1148]: <info>  [1552637490.3909] device (em4): Activation: starting connection 'em3' (442f*******************)
Mar 15 09:11:55 localhost network: Activation de l'interface em3 :  Connexion activée (chemin D-Bus actif : /org/freedesktop/NetworkManager/ActiveConnection/3)

우선, em3와 em4 사이에 상호 작용이 있는 것 같은데, 저는 한 번도 다음과 같은 일을 경험한 적이 없습니다 systemctl restart network.

localhost NetworkManager[14060]: <info>  [1552637774.4521] device (em3): Activation: starting connection 'em3' (442f**********************)
localhost nm-dispatcher: req:2 'down' [em3]: new request (4 scripts)
localhost nm-dispatcher: req:2 'down' [em3]: start running ordered scripts...
localhost NetworkManager[14060]: <info>  [1552637774.4535] device (em3): state change: disconnected -> prepare (reason 'none') [30 40 0]
localhost NetworkManager[14060]: <info>  [1552637774.4543] device (em3): state change: prepare -> config (reason 'none') [40 50 0]
localhost NetworkManager[14060]: <info>  [1552637774.4779] device (em3): state change: config -> ip-config (reason 'none') [50 70 0]
localhost NetworkManager[14060]: <info>  [1552637774.4787] dhcp4 (em3): activation: beginning transaction (timeout in 45 seconds)
localhost NetworkManager[14060]: <info>  [1552637774.4823] dhcp4 (em3): dhclient started with pid 14582

답변1

cat /proc/net/devem4에 일부 네트워크 전환이 있다는 것을 알고 있습니다 . 그러다가 서버를 물리적으로 설치할 때 2Gb 포트가 연결되어 있던 것을 기억했습니다. 그래서 em4에 연결된 네트워크 케이블을 뽑았더니 이제 문제가 해결된 것 같습니다.

관련 정보