View previous topic :: View next topic |
Author |
Message |
partiallynothing n00b
Joined: 28 May 2005 Posts: 5
|
Posted: Sun Jun 12, 2005 6:21 am Post subject: Binding Multiple IPs to a Single Interface |
|
|
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 |
|
|
ansient Guru
Joined: 22 Jan 2005 Posts: 445 Location: Argentina
|
Posted: Sun Jun 12, 2005 6:27 am Post subject: |
|
|
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 |
|
|
partiallynothing n00b
Joined: 28 May 2005 Posts: 5
|
Posted: Sun Jun 12, 2005 6:48 am Post subject: |
|
|
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 |
|
|
ansient Guru
Joined: 22 Jan 2005 Posts: 445 Location: Argentina
|
Posted: Sun Jun 12, 2005 7:13 am Post subject: |
|
|
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 |
|
|
partiallynothing n00b
Joined: 28 May 2005 Posts: 5
|
Posted: Sun Jun 12, 2005 6:42 pm Post subject: |
|
|
Why do the IP addresses have the 'slash'?
Why this:
And not this:
Thanks! _________________ Rob
[stripslashes.net] |
|
Back to top |
|
|
zonk Apprentice
Joined: 23 May 2005 Posts: 176
|
Posted: Sun Jun 12, 2005 6:52 pm Post subject: |
|
|
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 |
|
|
Daniel_walmsley n00b
Joined: 28 Aug 2003 Posts: 42 Location: Palmerston north
|
Posted: Sun Jun 12, 2005 9:02 pm Post subject: classles?? |
|
|
the /24 is siply another way of righting the subnet mask 255.255.255.0 |
|
Back to top |
|
|
|