Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Binding Multiple IPs to a Single Interface
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
partiallynothing
n00b
n00b


Joined: 28 May 2005
Posts: 5

PostPosted: Sun Jun 12, 2005 6:21 am    Post subject: Binding Multiple IPs to a Single Interface Reply with quote

I have been trying to bind multiple IPs to the same interface for some time and am having some extreme trouble. On Debian, I would have done the following in /etc/network/interfaces:
Code:

auto eth0
iface eth0 inet static
        address xxx.xxx.xxx.xxx
        netmask xxx.xxx.xxx.xxx
        network xxx.xxx.xxx.xxx
        broadcast xxx.xxx.xxx.xxx
        gateway xxx.xxx.xxx.xxx

auto eth0:0
iface eth0:0 inet static
        address xxx.xxx.xxx.xxx
        netmask xxx.xxx.xxx.xxx
        network xxx.xxx.xxx.xxx
        broadcast xxx.xxx.xxx.xxx
        gateway xxx.xxx.xxx.xxx

auto eth0:1
iface eth0:1 inet static
        address xxx.xxx.xxx.xxx
        netmask xxx.xxx.xxx.xxx
        network xxx.xxx.xxx.xxx
        broadcast xxx.xxx.xxx.xxx
        gateway xxx.xxx.xxx.xxx

Etc, etc, etc...

The Gentoo syntax is quite different. In my /etc/conf.d/net config file I currently have:
Code:

iface_eth0="xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
gateway="eth0/xxx.xxx.xxx.xxx"

I have tried things like this:
Code:

iface_eth0="xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
gateway="eth0/xxx.xxx.xxx.xxx"
iface_eth0:0="xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
gateway="eth0:0/xxx.xxx.xxx.xxx"
iface_eth0:1="xxx.xxx.xxx.xxx broadcast xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
gateway="eth0:1/xxx.xxx.xxx.xxx"

But this does not work. I do not have a /etc/conf.d/net.example file, so please do not ask for me to look at it.

I have been searching Google, the Gentoo Wiki, these forums, and asking in #gentoo for some time with no result. How can this be done?!

Thanks for your help!
_________________
Rob
[stripslashes.net]
Back to top
View user's profile Send private message
ansient
Guru
Guru


Joined: 22 Jan 2005
Posts: 445
Location: Argentina

PostPosted: Sun Jun 12, 2005 6:27 am    Post subject: Reply with quote

what version of baselayout are you using?

upgrade to 1.11.12-r4 if at all possible, and then look at your net.example file :p
Back to top
View user's profile Send private message
partiallynothing
n00b
n00b


Joined: 28 May 2005
Posts: 5

PostPosted: Sun Jun 12, 2005 6:48 am    Post subject: Reply with quote

I went ahead and upgraded to the version you specified, and I do now have a net.example file. New problem though :p. I do not fully understand the new syntax and am working on a remote machine. Can I get a multiple IP on the same interface example? I do not want to break networking on this remote machine. Thanks!
_________________
Rob
[stripslashes.net]
Back to top
View user's profile Send private message
ansient
Guru
Guru


Joined: 22 Jan 2005
Posts: 445
Location: Argentina

PostPosted: Sun Jun 12, 2005 7:13 am    Post subject: Reply with quote

Code:
# If you need more than one address, you can use something like this
# NOTE: ifconfig creates an aliased device for each extra IPv4 address
#       (eth0:1, eth0:2, etc)
#       iproute2 does not do this
#config_eth0=(
#   "192.168.0.2/24"
#   "192.168.0.3/24"
#   "192.168.0.4/24"
#)
Back to top
View user's profile Send private message
partiallynothing
n00b
n00b


Joined: 28 May 2005
Posts: 5

PostPosted: Sun Jun 12, 2005 6:42 pm    Post subject: Reply with quote

Why do the IP addresses have the 'slash'?
Why this:
Code:

192.168.0.2/24

And not this:
Code:

192.168.0.2

Thanks!
_________________
Rob
[stripslashes.net]
Back to top
View user's profile Send private message
zonk
Apprentice
Apprentice


Joined: 23 May 2005
Posts: 176

PostPosted: Sun Jun 12, 2005 6:52 pm    Post subject: Reply with quote

that's classless inter-domain routing addressing schemes.
they offer more flexibility than subnet masks. instead of 8, 16 or 32 bits identifying the network, you can have 13 to 27 bits for that.

128.8.27.18/16 would mean that the first 16 bits signify the network (128.8) and the last 16 bits represent the specific host number (27.18). a /13 allows you to represent over 524K hosts, a /27 allows you to represent 32 hosts. that way you can build networks that don't waste possible IP addresses in a world where IP addresses often are running short, it also reduces router overloading by having a single, high-level route represent many lower-level routes.
Back to top
View user's profile Send private message
Daniel_walmsley
n00b
n00b


Joined: 28 Aug 2003
Posts: 42
Location: Palmerston north

PostPosted: Sun Jun 12, 2005 9:02 pm    Post subject: classles?? Reply with quote

the /24 is siply another way of righting the subnet mask 255.255.255.0
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum