# Confusion with static ip on LAN

## zje

I installed an additional nic to give my gentoo box access to a separate LAN. I'm trying to configure it for a static ip, but instead of just setting up "eth1" with the ip, it creates a virtual interface "eth1:1"

I.E.

```

host ~ # cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0="dhcp"

config_eth1="10.0.0.20 netmask 255.255.255.0"

host ~ # ifconfig eth1       

eth1      Link encap:Ethernet  HWaddr 00:1c:21:20:1f:15  

          inet addr:169.254.4.121  Bcast:169.254.255.255  Mask:255.255.0.0

          inet6 addr: fe80::21b:21ff:fe20:1e14/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:14 errors:0 dropped:0 overruns:0 frame:0

          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:4788 (4.6 KiB)  TX bytes:4759 (4.6 KiB)

host ~ # ifconfig eth1:1

eth1:1    Link encap:Ethernet  HWaddr 00:1c:21:20:1f:15 

          inet addr:10.0.0.20  Bcast:10.0.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

```

Configuring it manually with ifconfig does the trick:

```

zakbox ~ # ifconfig eth1:1 down

zakbox ~ # ifconfig eth1 10.0.0.20

zakbox ~ # ifconfig eth1  

eth1      Link encap:Ethernet  HWaddr 00:1c:21:20:1f:15  

          inet addr:10.0.0.20  Bcast:10.255.255.255  Mask:255.0.0.0

          inet6 addr: fe80::21b:21ff:fe20:1e14/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:14 errors:0 dropped:0 overruns:0 frame:0

          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:4788 (4.6 KiB)  TX bytes:5501 (5.3 KiB)

```

 How can I get this to work correctly with the configuration scripts? 

Thanks!

----------

## NeddySeagoon

zje,

Welcome to Gentoo.

It looks like you don't have a /etc/init.d/net.eth1 file.

It should be a symlink to net.lo

With that in place you can do 

```
rc-update add net.eth1 default
```

so eth1 is started every boot.

As you get a self assigned IP address (link local) on eth1, it looks like eth1 is being started by hardware detection, correctly not finding a dhcp server then setting itself a link local address.

----------

## zje

Thanks! Your answer helped me find out the problem. I already had the symlink and net.eth1 in the default runlevel. However, I did have dhcpcd in the default runlevel instead of "net.eth0" After removing dhcpcd, I added net.eth0 and everything works as expected.   :Very Happy: 

----------

