Description

This howto will show you how to add multiple IP addresses to a single NIC on your Centos system.

Requirements

Explanation of requirements.

  1. Root access to the system
  2. A working network with at least 2 computers.

Doing the Work

Basic description of what will be done and what is expected.

  1. Make a copy of the interfaces config script:
  2. cat /etc/sysconfig/network-scripts/ifcfg-eth0 > /etc/sysconfig/network-scripts/ifcfg-eth0:1

  3. Edit the newly created alias and remove the HWADDR line, save and exit vi (esc :qw):
  4. vi /etc/sysconfig/network-scripts/ifcfg-eth0:1

  5. Restart the network:
  6. C6: service network restart or service NetworkManager restart
    C7: systemctl restart network.service or systemctl restart NetworkManager.service

Troubleshooting

How to test

Explanation troubleshooting basics and expectations.

  1. use ifconfig to see the currently configured interfaces:
  2. Ping the IPs to test:
  3. From a computer other than 192.168.1.4 or 192.168.1.5 issue the following commands and examine the output which should be similar to the examples below:

    ping 192.168.1.4

    ping 192.168.1.5

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #centoshelp on irc.freenode.net

Last Modified: 14 Dec, 2015 at 02:46:21