DevHeads.net

binding additional IP addresses to centos6 on one interface

I know this was discussed before, and I have seen a million ways of
doing this via online docs. I have a quick question that hopefully the
community can help me out with

I am trying to add a block of 10 IP addresses. Rather then create 10
different alias files, I want to use the RANGE file.

Docs say to use the following format:
IPADDR_START=x.x.x.x
IPADDR_END=x.x.x.x
CLONENUM_START=0

If the IP's that are given to you are on a completely seperate gateway /
netmask, how would you enter it into this file? Is it necessary? Please
advise.

Comments

Re: binding additional IP addresses to centos6 on one i

By John R Pierce at 11/13/2011 - 19:42

On 11/13/11 3:28 PM, Jonathan Vomacka wrote:
on a completely separate gateway/mask from what?

Re: binding additional IP addresses to centos6 on one i

By Reindl Harald at 11/13/2011 - 19:35

Am 14.11.2011 00:28, schrieb Jonathan Vomacka:
who needs ranges?
configure what you need!

cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
IPADDR=10.0.0.6
GATEWAY=10.0.0.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=static
TYPE=Ethernet
MODE=Managed
IPV6INIT=no
NM_CONTROLLED=no
USERCTL=no
MTU=1500

cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0:1
IPADDR=10.0.0.7
ONPARENT=yes

cat /etc/sysconfig/network-scripts/ifcfg-eth0:2
DEVICE=eth0:2
IPADDR=10.0.0.5
ONPARENT=yes

Re: binding additional IP addresses to centos6 on one i

By Jonathan Vomacka at 11/13/2011 - 19:42

Reindl,

A block of 10 IPV4 is not a lot, and they will all eventually be used.
My question is, my server IP is 66.80.x.x and my additional IPS are in
the 50.7.x.x range using a netmask of 255.255.255.248.

Can the netmask be written in the range file like it is in the ifcfg-eth0:0?

On 11/13/2011 6:35 PM, Reindl Harald wrote:

Re: binding additional IP addresses to centos6 on one i

By nux at 11/14/2011 - 07:03

Jonathan Vomacka writes:

Reindl,

Please do not top post.

255.255.255.248 gives you a total of 8 IPs, not 10, of which usually you
loose 3 for the network, broadcast and gw addresses.
You can assign those 5 in a range file without problems, you can also
specify the netmask like in a "normal" cfg file. It shouldn't be needed to
specify other settings.

Where I work we'd route the additional subnet through the IP you already
have on the server, thus allowing you to allocate _all_ 8 IPs as a range
on the loopback interface with a /32 netmask. See if your ISP can do this
for you.

Re: binding additional IP addresses to centos6 on one i

By Reindl Harald at 11/14/2011 - 07:36

Am 14.11.2011 12:03, schrieb ... at li dot nux.ro:
maybe you should open your eyes or learn to use you reply button which knows
better who wrote what and do not quote my name to anything i have not written

my only reply to this thread was at 0:35 and there was no top-post

Re: binding additional IP addresses to centos6 on one i

By Ljubomir Ljubojevic at 11/13/2011 - 20:15

255.255.255.248 gives you 6 (six), not 10 IP's.

I can not say about range file, but you can use IP calculator to find
out which IP start and end you need to write.
Enter data in this site and use "29" as an netmask. It use HostMin and
HostMax numbers for IPADDR_START and IPADDR_END:

<a href="http://jodies.de/ipcalc" title="http://jodies.de/ipcalc">http://jodies.de/ipcalc</a>

Re: binding additional IP addresses to centos6 on one i

By John R Pierce at 11/13/2011 - 20:28

On 11/13/11 4:15 PM, Ljubomir Ljubojevic wrote:
and one of those 6 is typically reserved for the gateway IP, leaving 5
usable hosts.

Re: binding additional IP addresses to centos6 on one i

By Ljubomir Ljubojevic at 11/13/2011 - 20:44

- Router A = ISP's router and default gateway to system B.
- System B (our server) has /30 subnet used to link router A (one IP)
and system B (other IP = xxx).
- On Router A route/direct /29 subnet (our 6 IP's) to point to System
B's main IP (other IP = xxx).
- Place all 6 IP's from subnet /29 as aliases to system B and DNAT/SNAT
internal IP's to them.

All router A will now is that traffic is coming from that /29 subnet
(those 6 IP's), and it will not care how they reached them. The response
traffic will be directed/routed via System B's main IP and system B will
accept them as it's own IP's and do what ever it is supposed to do.