# help configuring eth0:0 alias interface in openrc

## kiboko

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):

```
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:

```
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?

----------

## kiboko

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.

```

#!/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

}

```

----------

