Need help adding multiple ips on a dedi server w/ centos 6!

Issues related to configuring your network
Post Reply
linuxNewBie_010
Posts: 6
Joined: 2017/03/21 13:45:51

Need help adding multiple ips on a dedi server w/ centos 6!

Post by linuxNewBie_010 » 2017/03/21 13:55:38

Hi guys,

First thing is I am noob, very much in linux stuff.
So, I am getting the following error when trying to reconfig the ip range file, I did the exact same thing as I did before but not sure why this came up...
and not working now(I installed the wrong app after configuring so I had to reinstall OS).

I am trying to configure 2 range files namely,

Code: Select all

ifcfg-eth0-range1
ifcfg-eth0-range0

I copied the range file as "template" and just edited the values.
Only the first one worked, 2nd one is showing the following error:

Code: Select all

: integer expression expecteds/ifup-aliases: line 323: [: 194
: integer expression expecteds/ifup-aliases: line 330: [: 194
I checked again for the error but all seems right.

I am running a dedicated server on wholesaleinternet not sure if matters, but just in case.
Total are 10 ips, 5 are configured but the other 5 can't.

PS is there any way to STICK the ips permanently? So that If I reinstall OS later I don't have to reconfig it again?

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by TrevorH » 2017/03/21 14:48:27

Post the contents of the range files.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

linuxNewBie_010
Posts: 6
Joined: 2017/03/21 13:45:51

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by linuxNewBie_010 » 2017/03/21 17:19:13

Oh yes sorry here they are..

ifcfg-eth0-range1

Code: Select all

IPADDR_START=198.xxx.xxx.251
IPADDR_END=198.xxx.xxx.254
CLONENUM_START=0
NETMASK=255.255.255.248
GATEWAY=198.xxx.xxx.249


ifcfg-eth0-range0

Code: Select all

IPADDR_START=69.xx.xxx.194
IPADDR_END=69.xx.xxx.198
CLONENUM_START=4
NETMASK=255.255.255.248
GATEWAY=69.xx.xxx.193

linuxNewBie_010
Posts: 6
Joined: 2017/03/21 13:45:51

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by linuxNewBie_010 » 2017/03/22 17:34:49

umm bump.. hope bumping is fine..

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by TrevorH » 2017/03/22 18:28:18

You only want IPADDR_START=, IPADDR_END= and CLONENUM=, the rest belongs in the base ifcfg-$interface file that the range sits on top of.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

linuxNewBie_010
Posts: 6
Joined: 2017/03/21 13:45:51

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by linuxNewBie_010 » 2017/03/23 05:17:53

TrevorH wrote:You only want IPADDR_START=, IPADDR_END= and CLONENUM=, the rest belongs in the base ifcfg-$interface file that the range sits on top of.
Oh.. even NETMASK should be removed from the range files? I have seen some examples elsewhere they they do use NETMASK in range files.. Although the NETMASK is same for both the ranges but GATEWAY is diff for both ranges.

EDIT: I just checked and I do not have that ifcfg-$interface file.
Oh you mean like ifcfg-eth0 file? If so how can I add another gateway address to that file? It already has a default one.

linuxNewBie_010
Posts: 6
Joined: 2017/03/21 13:45:51

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by linuxNewBie_010 » 2017/03/27 19:24:26

shameless bump again

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Need help adding multiple ips on a dedi server w/ centos 6!

Post by TrevorH » 2017/03/27 20:02:58

If you mean how do you add specific routes then you create a /etc/sysconfig/network-scripts/route-$interface file (for some value of $interface) and put in there the latter portion of e.g. ip route add w.x.y.z/cidr-netmask via my.gateway.ip.address but without the 'ip route add' portion.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply