Article title: bind two or more IP addresses to a network card. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
This is explained by taking RedHat 7.3 as an example. The system versions may be different, but I think it is similar. Haha...
1. enter the directory:
[Root @ Linuxsir root] # cd/etc/sysconfig/network-scripts/
2: ifcfg-eh0: 0 in the eh0: 0 is the network card code, of course you can also use eh0: 1 and so on, as you like how to get, but in eh0: X must have ifcfg, this is the form below. We use eh0: 0 as an example.
Ifcfg-eth0: 0 contains such content, you can set it like this, and then the IP can be set by yourself. The same is true for settings like me.
# Please read/usr/share/doc/initscripts-*/sysconfig.txt
# For the documentation of these parameters.
USERCTL = 'no'
NETMASK = '2017. 255.255.0 '-"submask
BOOTPROTO = 'static '-protocol
DEVICE = 'eth0: 0'-"virtual Nic code
IPADDR = '1970. 168.0.9 '-"IP address set by myself
TYPE = 'ethernet'
OnBOOT = 'yes'-whether to activate the service after it is started
NETWORK = '1970. 168.0.0 '-"domain
BROADCAST = '1970. 168.0.255 '-"BROADCAST
4. save and exit, and then run the following command to activate the virtual Nic.
[Root @ Linuxsir root] # ifup eh0: 0
5. let's check if our virtual Nic is activated. use ifconfig, that is, the following.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service