View previous topic :: View next topic |
Author |
Message |
rbr28 Tux's lil' helper
Joined: 09 Feb 2004 Posts: 126
|
Posted: Sat Mar 29, 2014 12:24 am Post subject: IP aliasing / multiple IP's on one interface |
|
|
Can anyone tell me what I'm missing with trying to setup two IP addresses on one interface? I've done this on Redhat before with no problem, but I can't seem to get it working on Gentoo. I've tried using different syntax but my current /etc/conf.d/net is below. I followed the net.example file that is installed in the same location, but when I restart eth0 I only get eth0, no eth0:0.
Also want to add that if I do something like dhcpcd eth0:0 , the aliased interface does come up.
Thanks,
Vern
/etc/conf.d/net
config_eth0=(
"192.168.x.x/24"
"192.168.x.x/24"
)
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="192.168.1.1" |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Sat Mar 29, 2014 12:58 am Post subject: |
|
|
Please provide a reference to the example you used. It is outdated and needs to be fixed. Baselayout 1 used Bash arrays, but Baselayout 2 uses embedded newlines. Also, interface aliases are not an expected result. They were a workaround for ifconfig's inability to handle multiple addresses on one interface. Both the kernel and iproute2 handle this correctly. |
|
Back to top |
|
|
MrUlterior Guru
Joined: 22 Mar 2005 Posts: 511 Location: Switzerland
|
Posted: Mon Mar 31, 2014 7:22 am Post subject: Re: IP aliasing / multiple IP's on one interface |
|
|
Assuming you're using a recent baselayout ( ~ sys-apps/baselayout-2.2), then your /etc/conf.d/net should be
Code: |
modules="iproute2"
config_eth0="192.168.x.x/24 192.168.x.x/24"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="192.168.1.1"
|
OFC you will first need to:
Code: |
emerge -av sys-apps/iproute2
|
Then restart, and check it's working with:
Code: |
$ sudo ip addr
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 192.168.x.x/24 brd 192.168.x.255 scope global eth0
inet 192.168.x.x/24 brd 192.168.x.255 scope global eth0
|
_________________
Misanthropy 2.0 - enough hate to go around
|
|
Back to top |
|
|
|