Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
help configuring eth0:0 alias interface in openrc
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
kiboko
n00b
n00b


Joined: 29 May 2003
Posts: 59

PostPosted: Tue Oct 13, 2009 5:32 pm    Post subject: help configuring eth0:0 alias interface in openrc Reply with quote

I have a firewall host with two interfaces, eth0 external facing and eth1 internal.

I am trying to configure an alias interface eth0:0 via /etc/conf.d/net but do not understand how to get both the interfaces correctly configured with the correct netmask and broadcast values.

I currently have the following (without the eth0:0 alias):
Code:
config_eth0="10.0.0.22 netmask 255.255.255.224 brd 10.0.0.255"
routes_eth0="default via 10.0.0.65"

config_eth1="192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255"

The /usr/share/doc/openrc/net.example say I can add specify the primary interface with it's alias using the CIDR notation as follows, but I can't find a way to specify the netmask and broadcast addresses:
Code:
config_eth0="10.0.0.22/27 10.0.0.23/27"
routes_eth0="default via 10.0.0.65"

config_eth1="192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255"

Any ideas now to set up eth0 and eth0:0 correctly in this circumstance?
Back to top
View user's profile Send private message
kiboko
n00b
n00b


Joined: 29 May 2003
Posts: 59

PostPosted: Wed Oct 14, 2009 5:21 am    Post subject: Reply with quote

So far no new insights.

As a temporary solution I added a custom /etc/init.d/net.eth0_alias boot script to configure my alias device after eth0 is configured via the /etc/conf.d/net and /etc/init.d/net.eth0 files.
Code:

#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
  need net
  after net.eth0
}

start() {
  ebegin "Adding eth0 alias interfaces 10.0.0.23"
  ip addr add 10.0.0.23/27 brd 10.0.0.255 dev eth0 label eth0:0
}

stop() {
  ebegin "Deleting eth0 alias interfaces 10.0.0.23"
  ip addr del 10.0.0.23/27 brd 10.0.0.255 dev eth0 label eth0:0
}

restart() {
  stop
  start
}
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