1、临时添加
ip addr add 10.10.1.1/32 dev lo:1文章源自网吧系统维护-https://www.58pxe.com/7769.html
重启失效文章源自网吧系统维护-https://www.58pxe.com/7769.html
2、永久添加文章源自网吧系统维护-https://www.58pxe.com/7769.html
cd /etc/sysconfig/network-scripts文章源自网吧系统维护-https://www.58pxe.com/7769.html
cp ifcfg-lo ifcfg-lo:1文章源自网吧系统维护-https://www.58pxe.com/7769.html
[root@localhost network-scripts]# cat ifcfg-lo:1文章源自网吧系统维护-https://www.58pxe.com/7769.html
DEVICE=lo:1文章源自网吧系统维护-https://www.58pxe.com/7769.html
IPADDR=10.10.1.1文章源自网吧系统维护-https://www.58pxe.com/7769.html
NETMASK=255.255.255.255文章源自网吧系统维护-https://www.58pxe.com/7769.html
ONBOOT=yes文章源自网吧系统维护-https://www.58pxe.com/7769.html
NAME=loopback1文章源自网吧系统维护-https://www.58pxe.com/7769.html
[root@localhost network-scripts]# ip addr文章源自网吧系统维护-https://www.58pxe.com/7769.html
1: lo:文章源自网吧系统维护-https://www.58pxe.com/7769.html
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00文章源自网吧系统维护-https://www.58pxe.com/7769.html
inet 127.0.0.1/8 scope host lo文章源自网吧系统维护-https://www.58pxe.com/7769.html
valid_lft forever preferred_lft forever文章源自网吧系统维护-https://www.58pxe.com/7769.html
inet 10.10.1.1/32 brd 10.10.1.1 scope global lo:1文章源自网吧系统维护-https://www.58pxe.com/7769.html
valid_lft forever preferred_lft forever文章源自网吧系统维护-https://www.58pxe.com/7769.html
inet6 ::1/128 scope host文章源自网吧系统维护-https://www.58pxe.com/7769.html
valid_lft forever preferred_lft forever文章源自网吧系统维护-https://www.58pxe.com/7769.html
[root@localhost network-scripts]# ping -c1 10.10.1.1
PING 10.10.1.1 (10.10.1.1) 56(84) bytes of data.
64 bytes from 10.10.1.1: icmp_seq=1 ttl=64 time=0.045 ms
评论