redhat8中如何重启网络服务

 

1、系统

复制代码
[root@PC1 network-scripts]# hostnamectl
   Static hostname: PC1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 7d8c7dacd42740ff9603a3e8bbf222da
           Boot ID: 2111150973e94f82bb5297c08639adf4
    Virtualization: vmware
  Operating System: Red Hat Enterprise Linux 8.5 (Ootpa)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos
            Kernel: Linux 4.18.0-348.el8.x86_64
      Architecture: x86-64
复制代码

 

2、重启网络服务: nmcli c reload ens160 (ens160为网卡名称)

复制代码
[root@PC1 network-scripts]# ifconfig | head
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:0c:29:a8:a2:ab  txqueuelen 1000  (Ethernet)
        RX packets 26  bytes 1847 (1.8 KiB)
        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

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>
[root@PC1 network-scripts]# nmcli c reload ens160               ## 重启网络服务
[root@PC1 network-scripts]# ifconfig | head
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.33  netmask 255.255.255.0  broadcast 192.168.3.255
        inet6 fe80::20c:29ff:fea8:a2ab  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:a8:a2:ab  txqueuelen 1000  (Ethernet)
        RX packets 29  bytes 2039 (1.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28  bytes 3328 (3.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
复制代码

 

3、测试网络

复制代码
[root@PC1 network-scripts]# ping -c 3 www.baidu.com
PING www.a.shifen.com (39.156.66.14) 56(84) bytes of data.
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=1 ttl=51 time=11.7 ms
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=2 ttl=51 time=11.7 ms
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=3 ttl=51 time=11.5 ms

--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 11.548/11.648/11.700/0.143 ms
复制代码

 

posted @   小鲨鱼2018  阅读(5009)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2021-05-11 c 语言 6-15
2021-05-11 c语言 6-14
2021-05-11 c语言 6-13
2021-05-11 c语言 6-12
2021-05-11 c语言 6-11
2020-05-11 vcftools 软件的安装 GCC 编译器的安装
点击右上角即可分享
微信分享提示