How to implement multiple IP addresses for a network card under Linux

xiaoxiao2021-03-06  97

Linux network device profile is stored in / etc / sysconfig / network-scripts, for the first network device of the Ethernet, the configuration file name is generally IFCFG-ETH0 if you need to bind one IP address for the first network device Only create a file named IFCFG-Eth0: 0 in the / etc / sysconfig / network-scripts directory, and the content is:

Device = "eth0: 0"

Ipaddr = "211.100.10.119"

Netmask = "255.255.255.0"

Onboot = "yes"

Where Device is the name of the device, iPaddr is the IP address of this device, NetMask is a subnet mask, and OnBoot indicates automatically starting at the system startup.

If you need to bind more IP addresses, you only need to add Eth0: X of the DEVICE in the file name and file. Linux can support 255 IP alias.

转载请注明原文地址:https://www.9cbs.com/read-104991.html

New Post(0)