Home | Site Map | Cisco How ToNet How To | Wireless |Search | Forums | Services | Donations | Careers | About Us | Contact Us|

How to configure IP addresses on CentOS servers

Network Sharing , TCP/IP, Internet, Wireless, Exchange, IIS, ISA and Print

How to configure IP addresses on CentOS servers

Postby chicagotech » Fri Jul 28, 2017 11:13 am

1. To add newly assigned IP addresses from SSH, follow this procedure:

(Please follow the steps given below only on a Centos / Fedora.)
•Login to your server with SSH as root.
•Go to the /etc/sysconfig/network-scripts directory.
cd /etc/sysconfig/network-scripts/

2. To verify which interface you will use to add IP addresses. Typically, this will be eth0 for public IP addresses.

/sbin/ifconfig

3. •Restart the network:
/etc/init.d/network restart

4. To add multiple IP addresses at once:

Navigate to the following folder:

/etc/sysconfig/network-scripts/

In this folder, create a file named "ifcfg-ethX-range", without the quotes, and replacing X with the ID of the physical interface. For example, if you were using eth0, you would use the following file name:

ifcfg-eth0-range

In the file, enter the following information, modifying the entries as necessary.

IPADDR_START=10.0.0.1
IPADDR_END=10.0.0.100
CLONENUM_START=0
NETMASK=255.255.255.0

IPADDR_START means the start of the IP address range
IPADDR_END means the end of the IP address range
CLONENUM_START means the number assigned to the first virtual interface, for example eth0:0 or eth0:1, or eth0:8 as in the above screen capture
NETMASK is 255.255.255.255 for all secondary IP addresses to allow you to use the network and broadcast addresses on your server

After you have created the file, save and quit, and then restart the network service:

/etc/init.d/network restart
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on http://www.HowToNetworking.com
chicagotech
Site Admin
 
Posts: 6920
Joined: Mon Nov 27, 2006 1:24 pm
Location: Chicago USA

Return to Networking

Your Ad Here

Who is online

Users browsing this forum: No registered users and 3 guests