# Static IP?

## The_Great_Sephiroth

How do I do this in Gentoo? The Handbook is wrong. If I symlink net.lo to net.enp0s12 and edit the 'net' configuration file during startup it hangs for two minutes claiming that enp0s12 is not ready. Whatever happened to /etc/network/interfaces?

----------

## The Doctor

 *The_Great_Sephiroth wrote:*   

> How do I do this in Gentoo? The Handbook is wrong. If I symlink net.lo to net.enp0s12 and edit the 'net' configuration file during startup it hangs for two minutes claiming that enp0s12 is not ready. Whatever happened to /etc/network/interfaces?

 It isn't wrong. The problem must exist between the keyboard and the chair. Sorry.

If you want help finding the problem, please show us the files. Also note that you can't have any other networking software (ie wicd) active as they will fight for the interface and interfere with each other.

EDIT: Okay, removing edit

----------

## John R. Graham

I remembered a translation from old syntax to new but I guess I'd forgotten the context. Erasing my incorrect answer in shame (and also to not confuse posterity, to say nothing of the OP).   :Wink: 

- John

----------

## charles17

 *The_Great_Sephiroth wrote:*   

> How do I do this in Gentoo? The Handbook is wrong. If I symlink net.lo to net.enp0s12 and edit the 'net' configuration file during startup it hangs for two minutes claiming that enp0s12 is not ready. Whatever happened to /etc/network/interfaces?

 

Why not simply use the gui?

----------

## lexflex

 *charles17 wrote:*   

> 
> 
> Why not simply use the gui[/url]?

 

One might not use a graphical interface.... Or just want the network to be up regardless of typing 'startx'.

----------

## NeddySeagoon

The_Great_Sephiroth,

The net.lo script behaves as whatever its called as.

If you have net.enp0s12 -> net.lo, then enp0s12 in your net file, enp0s12 will get started.

I use eth0 as I don't suffer from 'persistent interface names'.

```
# 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 :]!).

modules="iproute2"

#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"

config_eth0="192.168.100.20/24 brd 192.168.100.255"

############ Switch Routers Helow Here ###########

# old Smoothwall

# routes_eth0="default via 192.168.100.1"

# VM Router

routes_eth0="default via 192.168.100.253"

```

----------

## The_Great_Sephiroth

Doc, nowhere in the handbook does it state anything about the network interfaces file. This tells me that I must use the "/etc/conf.d/net" file and symlinking net.lo to my interfaces. I followed the guide 100%, so no, the problem does not exist here. Per the guide I symlinked "net.enp0s12" to "net.lo". The configuration file is below.

```

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

config_enp0s12="10.0.4.231/24"

routes_enp0s12="default via 10.0.4.254"

dns_servers_enp0s12="10.0.4.254"

```

Also, this is on a NAS, so no GUI, no X, nothing. I don't need a static IP on a desktop, normally. The desktops and laptops work fine via Network Manager.

Neddy, I prefer the persistent names. I have had issues on occasion in the past when adding or removing network interfaces in other systems. It is one of the things that I like about Gentoo. The NIC on this server is enp0s12. Funny thing is that the one on my laptop is enp0s25.

So, according to the handbook, my configuration is correct, but it is not working. Just to avoid the question, here is my interface info. I had to walk to the machine and manually assign the address and such displayed here.

```

nas01 ~ # ifconfig

enp0s12: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.0.4.101  netmask 255.255.255.0  broadcast 10.0.4.255

        ether 00:16:ec:ca:6b:3f  txqueuelen 1000  (Ethernet)

        RX packets 99  bytes 12757 (12.4 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 73  bytes 8726 (8.5 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Local Loopback)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

----------

## dweezil-n0xad

What happens when you start net.enp0s12?

Here's my static ip config on my desktop:

```
msi dweezil # cat /etc/conf.d/net

config_eth0="192.168.1.101 netmask 255.255.255.0 brd 192.168.1.255"

routes_eth0="default via 192.168.1.1"

dns_servers_eth0="192.168.1.103" 

msi dweezil # /etc/init.d/net.eth0 start

net.eth0           | * Bringing up interface eth0

net.eth0           | *   192.168.1.101 ...                                                                [ ok ]

net.eth0           | *   Adding routes

net.eth0           | *     default via 192.168.1.1 ...                                                    [ ok ]

msi dweezil # ifconfig 

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.1.101  netmask 255.255.255.0  broadcast 192.168.1.255

        ether 44:8a:5b:9e:29:04  txqueuelen 1000  (Ethernet)

        RX packets 23594  bytes 29011221 (27.6 MiB)

        RX errors 0  dropped 1  overruns 0  frame 0

        TX packets 16655  bytes 1689839 (1.6 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 18  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Local Loopback)

        RX packets 4  bytes 240 (240.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 4  bytes 240 (240.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
```

----------

## The_Great_Sephiroth

I figured out the issue. I had it set to start in the default runlevel, but it wasn't starting. No clue as to why, but deleting it and adding it again fixed it. Now the interface starts and sets the correct IP and routes. Thank you to those who helped.

----------

