How to assign an ip address to your network card
To add an ip or several ips to your network card,we will do the following;
First go to your eth path with command :
cd /etc/sysconfig/network-scripts/
Then list the contents with either ls or dir commands
You are going to see many files including something like :
ifcfg-eth0 or ifcfg-eth1
If you see both of them,then possibly eth0 is being used but make sure and ask your hosting provider or try and learn!
Suppose it is eth0,then you shall create a new file with the command below :
nano ifcfg-eth0-range0
Write inside :
IPADDR_START=first ip
IPADDR_END=last ip
CLONENUM_START=5
NETMASK=255.255.255.248
If you are adding the range 174.36.112.147 – 174.36.112.151 , then first and last ip should be replaced in the correct order.
Restart your network :
/etc/init.d/network restart
Check your ips with ifconfig command :
ifconfig
If you want to add more ips,then do the same procedure but increase clonenum_start value as much as the number of the ips you add each time.
Leave a Reply