Home > System Tutorial > LINUX > body text

How to add local loopback address on CentOS7?

WBOY
Release: 2024-01-13 20:00:05
forward
1223 people have browsed it

1、临时添加

ip addr add 10.10.1.1/32 dev lo:1

重启失效

2、永久添加

cd /etc/sysconfig/network-scripts

cp ifcfg-lo ifcfg-lo:1

[root@localhost network-scripts]# cat ifcfg-lo:1

DEVICE=lo:1

IPADDR=10.10.1.1

NETMASK=255.255.255.255

ONBOOT=yes

NAME=loopback1

[root@localhost network-scripts]# ip addr

1: lo: mtu 65536 qdisc noqueue state UNKNOWN

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

valid_lft forever preferred_lft forever

inet 10.10.1.1/32 brd 10.10.1.1 scope global lo:1

valid_lft forever preferred_lft forever

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

[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

The above is the detailed content of How to add local loopback address on CentOS7?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template