高并发与负载均衡-keepalived-实验2

本文档记录了在CentOS7系统上配置和管理Keepalived以实现高并发与负载均衡的过程。通过`ipvsadm`命令展示了虚拟服务器的状态,并使用`systemctl`管理Keepalived服务,确保了VRRP实例的正常切换。在配置文件中定义了VRRP实例、虚拟路由、真实服务器及其健康检查,实现了流量在多个后端服务器之间的负载分配。
摘要由CSDN通过智能技术生成

[root@centos7-1 .ssh]# ipvsadm -ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
[root@centos7-1 .ssh]# vi /etc/keepalived/keepalived.conf
[root@centos7-1 .ssh]# vi /etc/keepalived/keepalived.conf
[root@centos7-1 .ssh]# systemctl stop keepalived
[root@centos7-1 .ssh]# systemctl start keepalived
[root@centos7-1 .ssh]# systemctl status keepalived
● keepalived.service - LVS and VRRP High Availability Monitor
   Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
   Active: active (running) since 五 2019-12-13 14:57:45 CST; 6s ago
  Process: 26379 ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 26380 (keepalived)
    Tasks: 3
   CGroup: /system.slice/keepalived.service
           ├─26380 /usr/sbin/keepalived -D
           ├─26381 /usr/sbin/keepalived -D
           └─26382 /usr/sbin/keepalived -D

12月 13 14:57:48 centos7-1 Keepalived_vrrp[26382]: VRRP_Instance(VI_1) Transition to MASTER STATE
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: VRRP_Instance(VI_1) Entering MASTER STATE
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: VRRP_Instance(VI_1) setting protocol iptable drop rule
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: VRRP_Instance(VI_1) setting protocol VIPs.
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: Sending gratuitous ARP on ens33 for 192.168.159.100
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs on ens33 for 192...9.100
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: Sending gratuitous ARP on ens33 for 192.168.159.100
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: Sending gratuitous ARP on ens33 for 192.168.159.100
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: Sending gratuitous ARP on ens33 for 192.168.159.100
12月 13 14:57:49 centos7-1 Keepalived_vrrp[26382]: Sending gratuitous ARP on ens33 for 192.168.159.100
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos7-1 .ssh]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.159.10  netmask 255.255.255.0  broadcast 192.168.159.255
        inet6 fe80::20c:29ff:fe99:5ef2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:99:5e:f2  txqueuelen 1000  (Ethernet)
        RX packets 29856  bytes 2261862 (2.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44693  bytes 3066703 (2.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000  

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 128  bytes 11136 (10.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 128  bytes 11136 (10.8 KiB)
        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:98:fb:a9  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

[root@centos7-1 .ssh]# systemctl stop keepalived
[root@centos7-1 .ssh]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.159.10  netmask 255.255.255.0  broadcast 192.168.159.255
        inet6 fe80::20c:29ff:fe99:5ef2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:99:5e:f2  txqueuelen 1000  (Ethernet)
        RX packets 29900  bytes 2266668 (2.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44760  bytes 3073302 (2.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000  

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 128  bytes 11136 (10.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 128  bytes 11136 (10.8 KiB)
        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:98:fb:a9  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

[root@centos7-1 ~]# tail -f /var/log/messages
Dec 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:25 centos7-1 avahi-daemon[4910]: Registering new address record for 192.168.159.100 on ens
Dec 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs 00
Dec 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
Dec 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.159.100
^C
[root@centos7-1 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.159.10  netmask 255.255.255.0  broadcast 192.168.159.255
        inet6 fe80::20c:29ff:fe99:5ef2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:99:5e:f2  txqueuelen 1000  (Ethernet)
        RX packets 30803  bytes 2367038 (2.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 46012  bytes 3178062 (3.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000  

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 128  bytes 11136 (10.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 128  bytes 11136 (10.8 KiB)
        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:98:fb:a9  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

[root@centos7-1 ~]# cd /etc/sysconfig/network-scripts/
[root@centos7-1 network-scripts]# ll
总用量 252
-rw-r--r--  1 root root   153 11月 20 15:19 ifcfg-ens33
-rw-r--r--. 1 root root   254 8月  24 2018 ifcfg-lo
lrwxrwxrwx. 1 root root    24 9月  27 02:43 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root   654 8月  24 2018 ifdown-bnep
-rwxr-xr-x. 1 root root  6532 8月  24 2018 ifdown-eth
-rwxr-xr-x. 1 root root  6190 10月 31 2018 ifdown-ib
-rwxr-xr-x. 1 root root   781 8月  24 2018 ifdown-ippp
-rwxr-xr-x. 1 root root  4540 8月  24 2018 ifdown-ipv6
lrwxrwxrwx. 1 root root    11 9月  27 02:43 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root  2130 8月  24 2018 ifdown-post
-rwxr-xr-x. 1 root root  1068 8月  24 2018 ifdown-ppp
-rwxr-xr-x. 1 root root   870 8月  24 2018 ifdown-routes
-rwxr-xr-x. 1 root root  1456 8月  24 2018 ifdown-sit
-rwxr-xr-x. 1 root root  1621 3月  18 2017 ifdown-Team
-rwxr-xr-x. 1 root root  1556 3月  18 2017 ifdown-TeamPort
-rwxr-xr-x. 1 root root  1462 8月  24 2018 ifdown-tunnel
lrwxrwxrwx. 1 root root    22 9月  27 02:43 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12415 8月  24 2018 ifup-aliases
-rwxr-xr-x. 1 root root   910 8月  24 2018 ifup-bnep
-rwxr-xr-x. 1 root root 13475 8月  24 2018 ifup-eth
-rwxr-xr-x. 1 root root 10114 10月 31 2018 ifup-ib
-rwxr-xr-x. 1 root root 12075 8月  24 2018 ifup-ippp
-rwxr-xr-x. 1 root root 11893 8月  24 2018 ifup-ipv6
lrwxrwxrwx. 1 root root     9 9月  27 02:43 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root   650 8月  24 2018 ifup-plip
-rwxr-xr-x. 1 root root  1064 8月  24 2018 ifup-plusb
-rwxr-xr-x. 1 root root  4997 8月  24 2018 ifup-post
-rwxr-xr-x. 1 root root  4154 8月  24 2018 ifup-ppp
-rwxr-xr-x. 1 root root  2001 8月  24 2018 ifup-routes
-rwxr-xr-x. 1 root root  3303 8月  24 2018 ifup-sit
-rwxr-xr-x. 1 root root  1755 3月  18 2017 ifup-Team
-rwxr-xr-x. 1 root root  1876 3月  18 2017 ifup-TeamPort
-rwxr-xr-x. 1 root root  2711 8月  24 2018 ifup-tunnel
-rwxr-xr-x. 1 root root  1836 8月  24 2018 ifup-wireless
-rwxr-xr-x. 1 root root  5419 8月  24 2018 init.ipv6-global
-rw-r--r--. 1 root root 20671 8月  24 2018 network-functions
-rw-r--r--. 1 root root 31027 8月  24 2018 network-functions-ipv6
[root@centos7-1 network-scripts]# vi ifcfg-ens33
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]# cp ifcfg-ens33 ifcfg-ens33.bak
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]# rm -rf ifcfg-ens33.swp
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]# rm -fr ifcfg-ens33.swp
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]# rm -fr ifcfg-ens33
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]# rm -fr ./ifcfg-ens33.swp
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]# rm -rf ifcfg-ens33.swp
[root@centos7-1 network-scripts]# l.
.  ..  .ifcfg-ens33.swp
[root@centos7-1 network-scripts]#  rm -rf ifcfg-ens33.swp
[root@centos7-1 network-scripts]# ll
总用量 252
-rw-r--r--  1 root root   153 12月 13 15:11 ifcfg-ens33.bak
-rw-r--r--. 1 root root   254 8月  24 2018 ifcfg-lo
lrwxrwxrwx. 1 root root    24 9月  27 02:43 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root   654 8月  24 2018 ifdown-bnep
-rwxr-xr-x. 1 root root  6532 8月  24 2018 ifdown-eth
-rwxr-xr-x. 1 root root  6190 10月 31 2018 ifdown-ib
-rwxr-xr-x. 1 root root   781 8月  24 2018 ifdown-ippp
-rwxr-xr-x. 1 root root  4540 8月  24 2018 ifdown-ipv6
lrwxrwxrwx. 1 root root    11 9月  27 02:43 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root  2130 8月  24 2018 ifdown-post
-rwxr-xr-x. 1 root root  1068 8月  24 2018 ifdown-ppp
-rwxr-xr-x. 1 root root   870 8月  24 2018 ifdown-routes
-rwxr-xr-x. 1 root root  1456 8月  24 2018 ifdown-sit
-rwxr-xr-x. 1 root root  1621 3月  18 2017 ifdown-Team
-rwxr-xr-x. 1 root root  1556 3月  18 2017 ifdown-TeamPort
-rwxr-xr-x. 1 root root  1462 8月  24 2018 ifdown-tunnel
lrwxrwxrwx. 1 root root    22 9月  27 02:43 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12415 8月  24 2018 ifup-aliases
-rwxr-xr-x. 1 root root   910 8月  24 2018 ifup-bnep
-rwxr-xr-x. 1 root root 13475 8月  24 2018 ifup-eth
-rwxr-xr-x. 1 root root 10114 10月 31 2018 ifup-ib
-rwxr-xr-x. 1 root root 12075 8月  24 2018 ifup-ippp
-rwxr-xr-x. 1 root root 11893 8月  24 2018 ifup-ipv6
lrwxrwxrwx. 1 root root     9 9月  27 02:43 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root   650 8月  24 2018 ifup-plip
-rwxr-xr-x. 1 root root  1064 8月  24 2018 ifup-plusb
-rwxr-xr-x. 1 root root  4997 8月  24 2018 ifup-post
-rwxr-xr-x. 1 root root  4154 8月  24 2018 ifup-ppp
-rwxr-xr-x. 1 root root  2001 8月  24 2018 ifup-routes
-rwxr-xr-x. 1 root root  3303 8月  24 2018 ifup-sit
-rwxr-xr-x. 1 root root  1755 3月  18 2017 ifup-Team
-rwxr-xr-x. 1 root root  1876 3月  18 2017 ifup-TeamPort
-rwxr-xr-x. 1 root root  2711 8月  24 2018 ifup-tunnel
-rwxr-xr-x. 1 root root  1836 8月  24 2018 ifup-wireless
-rwxr-xr-x. 1 root root  5419 8月  24 2018 init.ipv6-global
-rw-r--r--. 1 root root 20671 8月  24 2018 network-functions
-rw-r--r--. 1 root root 31027 8月  24 2018 network-functions-ipv6
[root@centos7-1 network-scripts]# type ifcfg-ens33
-bash: type: ifcfg-ens33: 未找到
[root@centos7-1 network-scripts]# type ifcfg-ens33.bak
-bash: type: ifcfg-ens33.bak: 未找到
[root@centos7-1 network-scripts]# ifcfg-ens33.bak
bash: ifcfg-ens33.bak: 未找到命令...
[root@centos7-1 network-scripts]# mv ifcfg-ens33.bak ifcfg-ens33
[root@centos7-1 network-scripts]# ll
总用量 252
-rw-r--r--  1 root root   153 12月 13 15:11 ifcfg-ens33
-rw-r--r--. 1 root root   254 8月  24 2018 ifcfg-lo
lrwxrwxrwx. 1 root root    24 9月  27 02:43 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root   654 8月  24 2018 ifdown-bnep
-rwxr-xr-x. 1 root root  6532 8月  24 2018 ifdown-eth
-rwxr-xr-x. 1 root root  6190 10月 31 2018 ifdown-ib
-rwxr-xr-x. 1 root root   781 8月  24 2018 ifdown-ippp
-rwxr-xr-x. 1 root root  4540 8月  24 2018 ifdown-ipv6
lrwxrwxrwx. 1 root root    11 9月  27 02:43 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root  2130 8月  24 2018 ifdown-post
-rwxr-xr-x. 1 root root  1068 8月  24 2018 ifdown-ppp
-rwxr-xr-x. 1 root root   870 8月  24 2018 ifdown-routes
-rwxr-xr-x. 1 root root  1456 8月  24 2018 ifdown-sit
-rwxr-xr-x. 1 root root  1621 3月  18 2017 ifdown-Team
-rwxr-xr-x. 1 root root  1556 3月  18 2017 ifdown-TeamPort
-rwxr-xr-x. 1 root root  1462 8月  24 2018 ifdown-tunnel
lrwxrwxrwx. 1 root root    22 9月  27 02:43 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12415 8月  24 2018 ifup-aliases
-rwxr-xr-x. 1 root root   910 8月  24 2018 ifup-bnep
-rwxr-xr-x. 1 root root 13475 8月  24 2018 ifup-eth
-rwxr-xr-x. 1 root root 10114 10月 31 2018 ifup-ib
-rwxr-xr-x. 1 root root 12075 8月  24 2018 ifup-ippp
-rwxr-xr-x. 1 root root 11893 8月  24 2018 ifup-ipv6
lrwxrwxrwx. 1 root root     9 9月  27 02:43 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root   650 8月  24 2018 ifup-plip
-rwxr-xr-x. 1 root root  1064 8月  24 2018 ifup-plusb
-rwxr-xr-x. 1 root root  4997 8月  24 2018 ifup-post
-rwxr-xr-x. 1 root root  4154 8月  24 2018 ifup-ppp
-rwxr-xr-x. 1 root root  2001 8月  24 2018 ifup-routes
-rwxr-xr-x. 1 root root  3303 8月  24 2018 ifup-sit
-rwxr-xr-x. 1 root root  1755 3月  18 2017 ifup-Team
-rwxr-xr-x. 1 root root  1876 3月  18 2017 ifup-TeamPort
-rwxr-xr-x. 1 root root  2711 8月  24 2018 ifup-tunnel
-rwxr-xr-x. 1 root root  1836 8月  24 2018 ifup-wireless
-rwxr-xr-x. 1 root root  5419 8月  24 2018 init.ipv6-global
-rw-r--r--. 1 root root 20671 8月  24 2018 network-functions
-rw-r--r--. 1 root root 31027 8月  24 2018 network-functions-ipv6
[root@centos7-1 network-scripts]# cat ifcfg-ens33
TYPE=Ethernet
DEFROUTE=yes
BOOTPROTO=static
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.159.10
GATEWAY=192.168.159.2
NETMASK=255.255.255.0
DNS1=193.168.159.2
[root@centos7-1 network-scripts]# systemctl status keepalived
● keepalived.service - LVS and VRRP High Availability Monitor
   Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
   Active: active (running) since 五 2019-12-13 15:02:20 CST; 15min ago
  Process: 26693 ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 26695 (keepalived)
    Tasks: 3
   CGroup: /system.slice/keepalived.service
           ├─26695 /usr/sbin/keepalived -D
           ├─26696 /usr/sbin/keepalived -D
           └─26697 /usr/sbin/keepalived -D

12月 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:25 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: VRRP_Instance(VI_1) Sending/queueing gratuito...00
12月 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
12月 13 15:02:30 centos7-1 Keepalived_vrrp[26697]: Sending gratuitous ARP on ens33 for 192.168.1...00
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos7-1 network-scripts]# systemctl stop keepalived
[root@centos7-1 network-scripts]# systemctl start keepalived
[root@centos7-1 network-scripts]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.159.10  netmask 255.255.255.0  broadcast 192.168.159.255
        inet6 fe80::20c:29ff:fe99:5ef2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:99:5e:f2  txqueuelen 1000  (Ethernet)
        RX packets 32723  bytes 2568856 (2.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48413  bytes 3385122 (3.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000  

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 128  bytes 11136 (10.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 128  bytes 11136 (10.8 KiB)
        T

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值