Bind multiple IP addresses to the network card of CentOS

Source: Internet
Author: User
All devices in CentOS are files. the NIC is also defined in the file. to bind an IP address, you only need to change the file. nic files are located in the directory:/etc/sysconfig/network-scripts to query the current IP information: ifconfig: eth0Linkencap: all devices in Etherne CentOS are files. the NIC is also defined in the file. to bind an IP address, you only need to change the file. nic files are in the directory: /Etc/sysconfig/network-scripts: ifconfig: eth0 Link encap: Ethernet HWaddr 00: 50: 56: AC: 6B: 0F   Inet addr: 42.51.135.206 Bcast: 42.51.135.255 Mask: 255.255.255.0 Inet6 addr: fe80 :: 250: 56ff: fead: 6b0f/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 RX packets: 374772 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 35165 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 fig: 1000   RX bytes: 28759089 (27.4 MiB) TX bytes: 4779278 (4.5 MiB) there is a file under the current directory: ifcfg-eth0 new file under the Directory: ifcfg-eth0: 1 content is as follows: DEVICE = eth0: 1 IPADDR = 255.255.255.0HWADDR = 00: 50: 56: AC: 6B: 0FNM_CONTROLLED = yesONBOOT = yesBOOTPROTO = dhcpTYPE = EthernetIPV6INIT = noUSERCTL = no ifcfg-eth0: 2 DEVICE = eth0: 2 IPADDR = 255.255.255.0HWADDR = 00: 50: 56: AC: 6B: 0FNM_CONTROLLED = yesONBOOT = yesBOOTPROTO = dhcpTYPE = EthernetIPV6INIT = noUSERCTL = no ifcfg-eth0: 3 DEVICE = eth0: 3 IPADDR = 42.51.138.3NETMASK = 255.255.255.0HWADDR = 00: 50: 56: AC: 6B: 0FNM_CONTROLLED = yesONBOOT = yesBOOTPROTO = dhcpTYPE = EthernetIPV6INIT = noUSERCTL = no restart Nic: service network restart: check the IP address eth0 at this time. Link encap: Ethernet HWaddr 00: 50: 56: AC: 6B: 0F   Inet addr: 42.51.135.206 Bcast: 42.51.135.255 Mask: 255.255.255.0 Inet6 addr: fe80 :: 250: 56ff: fead: 6b0f/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 RX packets: 384344 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 35241 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 fig: 1000   RX bytes: 29462159 (28.0 MiB) TX bytes: 4791402 (4.5 MiB) eth0: 1 Link encap: Ethernet HWaddr 00: 50: 56: AC: 6B: 0F   Inet addr: 42.51.138.1 Bcast: 42.51.138.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 eth0: 2 Link encap: Ethernet HWaddr 00: 50: 56: AC: 6B: 0F   Inet addr: 42.51.138.2 Bcast: 42.51.138.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 eth0: 3 Link encap: Ethernet HWaddr 00: 50: 56: AC: 6B: 0F   Inet addr: 42.51.138.3 Bcast: 42.51.138.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1 test: ping the above IP addresses on other machines.
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.