service network restart 无法启动,ifconfig内容异常
程序员文章站
2022-03-12 07:50:19
...
问题日志:
[[email protected] network-scripts]# service network restart
Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
[FAILED]
[[email protected] network-scripts]# systemctl status network.service
● 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 Sat 2020-05-23 14:27:44 CST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 3332 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
May 23 14:27:44 hadoop-01 network[3332]: RTNETLINK answers: File exists
May 23 14:27:44 hadoop-01 network[3332]: RTNETLINK answers: File exists
May 23 14:27:44 hadoop-01 network[3332]: RTNETLINK answers: File exists
May 23 14:27:44 hadoop-01 network[3332]: RTNETLINK answers: File exists
May 23 14:27:44 hadoop-01 network[3332]: RTNETLINK answers: File exists
May 23 14:27:44 hadoop-01 network[3332]: RTNETLINK answers: File exists
May 23 14:27:44 hadoop-01 systemd[1]: network.service: control process exit...=1
May 23 14:27:44 hadoop-01 systemd[1]: Failed to start LSB: Bring up/down ne...g.
May 23 14:27:44 hadoop-01 systemd[1]: Unit network.service entered failed state.
May 23 14:27:44 hadoop-01 systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
现象(NET模式,现在与主机无法ping通):
[[email protected] ~]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b7:62:bc txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[[email protected] ~]#
场景:虚拟机环境+2台克隆虚拟机,设置静态ip之后,出现这个问题
解决方案:
编辑:/etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
IPADDR="192.168.1.12"
NETMASK="255.255.255.0"
NETWORK="192.168.1.1"
GATEWAY="192.168.1.2"
DNS1=8.8.8.8
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="ens33"
UUID="c5dabc99-22de-41ec-ab3b-da21025a1b69"
DEVICE="ens33"
ONBOOT="yes"