Top

Centos-VIP

VIP(virtual ip)

我的环境是Centos7.4!

1. 复制网卡配置文件并配置

[root@server ~]# cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33:1
[root@server ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33:1
1
2
3
4
5
6
7
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.32.35
NETMASK=255.255.255.0
NAME=ens33:1
DEVICE=ens33:1
ONBOOT=yes
[root@server ~]# systemctl restart network

2. 测试

[root@server ~]# ping 192.168.32.35 -c 2
PING 192.168.32.35 (192.168.32.35) 56(84) bytes of data.
64 bytes from 192.168.32.35: icmp_seq=1 ttl=64 time=0.008 ms
64 bytes from 192.168.32.35: icmp_seq=2 ttl=64 time=0.046 ms

--- 192.168.32.35 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.008/0.027/0.046/0.019 ms


        
 上一篇

  Centos, Nginx, VIP