# Why does netifrc not set routes automatically like CentOS?

## ascendant

Hi, all

I'm curious about an issue I've encountered setting up networking on a Gentoo guest as compared to a CentOS guest in KVM.  CentOS is able to automatically set routes when bringing up the network without extra configuration, but Gentoo is not able to.  I've searched forums and Google, and couldn't find others with a similar issue so I wonder if there's a configuration option or kernel module missing that prevents autodetection from working.

Here's the full configuration for CentOS, which works:

```
DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes

USERCTL=no

IPV6INIT=no

PEERDNS=yes

TYPE=Ethernet

NETMASK=255.255.255.255

IPADDR=149.56.xx.xx

GATEWAY=192.99.233.254

ARP=yes

HWADDR=02:00:00:xx:xx:xx
```

```

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         192.99.233.254  0.0.0.0         UG    100    0        0 eth0

149.56.xx.xx   0.0.0.0         255.255.255.255 UH    100    0        0 eth0

192.99.233.254  0.0.0.0         255.255.255.255 UH    100    0        0 eth0

```

Here's the expected configuration for Gentoo:

```
config_eth0="149.56.xx.xx"

routes_eth0="default via 192.99.233.254"

```

 Which results in 

```
 * Adding routes...

 *  default via 192.99.233.254 ...

RTNETLINK answers: Network is unreachable           [ !! ]
```

and

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
```

These lines were added to the net file in order to get routes off the container:

```
routes_eth0="192.99.233.254/32 dev eth0

149.56.xx.xx/32 dev eth0

default via 192.99.233.254"
```

 I eventually found this to be the minimum configuration required: 

```
config_eth0="149.56.xx.xx"

routes_eth0="192.99.233.254/32

default via 192.99.233.254"

```

----------

## NeddySeagoon

ascendant,

Your syntax is not correct. You need ...

```
routes_eth0="default via 192.168.0.1"
```

See the Gentoo Handbook

----------

## ascendant

Hi NeddySeagoon,

Thanks for the reply!  Sorry, this was a copy/paste error.  The expected config file did have that line as you described it:

routes_eth0="default via 192.99.233.254"

The "Network is unreachable" error occurs with that configuration, edited.

----------

