Dual-IP settings for a single network card in Linux
Source: Internet
Author: User
Dual-IP settings for a single Linux NIC-Linux Enterprise Application-Linux server application information. For details, refer to the following section. 1. Configure the first IP Address:
[Root @ Linux root] # cd/etc/sysconfig/network-scripts
[Root @ Linux network-scripts] # vi ifcfg-eth0
DEVICE = eth0
BOOTPROTO = static
BROADCAST = 192.168.80.255 // * BROADCAST address *//
IPADDR = 192.168.80.189 // * The first IP Address *//
NETMASK = 255.255.255.0 // * network mask *//
NETWORK = 192.168.80.0 // * NETWORK segment *//
ONBOOT = yes
: Wq // * Save and exit *//
2. Copy the first IP address configuration file to the second IP Address Configuration File and modify the IP Address:
[Root @ Linux network-scripts] # cp ifcfg-eth0 ifcfg-eth1
[Root @ Linux network-scripts] # vi ifcfg-eth1
DEVICE = eth0
BOOTPROTO = static
BROADCAST = 192.168.80.255 // * BROADCAST address *//
IPADDR = 192.168.80.199 // * Second IP Address *//
NETMASK = 255.255.255.0 // * network mask *//
NETWORK = 192.168.80.0 // * NETWORK segment *//
ONBOOT = yes
: Wq // * Save and exit *//
3. Restart the NIC:
[Root @ Linux network-scripts] # service network restart
Or:
[Root @ Linux network-scripts] # ifdown eth0
[Root @ Linux network-scripts] # ifup eth0
Or
[Root @ Linux network-scripts] # ifconfig eth0 down
[Root @ Linux network-scripts] # ifconfig eth0 up
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