# network config

## Vieri

Hi,

I'd like to configure a NIC's (enp5s3) IP address to 10.215.144.91/16 but I do not want the "main" routing table to include:

```
10.215.0.0/16 dev enp5s3 proto kernel scope link src 10.215.144.91
```

Instead, I'd like to add the following to table "main":

```

10.215.144.0/22 dev enp5s3 proto kernel scope link src 10.215.144.91

10.215.246.0/23 dev enp5s3 proto kernel scope link src 10.215.144.91

10.215.248.0/24 dev enp5s3 proto kernel scope link src 10.215.144.91

```

How can I do that in /etc/conf.d/net?

Currently I have this (just take a look at enp5s3):

```

# cat /etc/conf.d/net

dns_domain="mydomain.org"

dns_search="mydomain.org"

dns_servers="10.215.144.31 10.215.144.35"

config_enp5s3="10.215.144.91/16 10.215.144.6/16 192.168.144.91/24"

routes_enp5s3="

192.168.250.0/24 gw 10.215.147.115

192.168.251.0/24 gw 10.215.147.115

"

config_enp3s2="192.168.210.1/23 192.168.212.1/24"

routes_enp3s2="

10.215.147.62 gw 192.168.210.1

"

config_enp5s1="172.20.11.62/28"

routes_enp5s1="

10.215.0.0/17 gw 172.20.11.49

10.215.128.0/20 gw 172.20.11.49

10.215.148.0/22 gw 172.20.11.49

10.215.152.0/21 gw 172.20.11.49

10.215.160.0/19 gw 172.20.11.49

10.215.192.0/19 gw 172.20.11.49

10.215.224.0/20 gw 172.20.11.49

10.215.240.0/22 gw 172.20.11.49

10.215.244.0/23 gw 172.20.11.49

10.215.249.0/24 gw 172.20.11.49

10.215.250.0/23 gw 172.20.11.49

10.215.252.0/22 gw 172.20.11.49

85.xx.xx.xx gw 172.20.11.49

"

config_enp5s0="172.28.17.105/29"

routes_enp5s0="

10.215.137.241/32 gw 172.28.17.110

10.215.134.1/32 gw 172.28.17.110

10.215.134.254/32 gw 172.28.17.110

10.215.247.194/32 gw 172.28.17.110

"

config_enp4s1="172.16.0.1/28"

routes_enp4s1="

10.215.147.61 gw 172.16.0.1

10.215.144.90 gw 172.16.0.2

10.215.144.92 gw 172.16.0.2

default via 172.16.0.2

"

```

I have to do this manually:

```

ip route del 10.215.0.0/16 dev enp5s3 proto kernel scope link src 10.215.144.91

ip route add 10.215.144.0/22 dev enp5s3 proto kernel scope link src 10.215.144.91

ip route add 10.215.246.0/23 dev enp5s3 proto kernel scope link src 10.215.144.91

ip route add 10.215.248.0/24 dev enp5s3 proto kernel scope link src 10.215.144.91

```

Can I set this up in Gentoo?

thanks,

Vieri

[EDIT]

I guess I can do:

```
config_enp5s3="10.215.144.91/32 10.215.144.6/32 192.168.144.91/24"

routes_enp5s3="

10.215.144.0/22 dev enp5s3 proto kernel scope link src 10.215.144.91 metric 1

10.215.246.0/23 dev enp5s3 proto kernel scope link src 10.215.144.91 metric 1

10.215.248.0/24 dev enp5s3 proto kernel scope link src 10.215.144.91 metric 1

192.168.250.0/24 gw 10.215.147.115

192.168.251.0/24 gw 10.215.147.115

"
```

Any caveats I should be aware of?

----------

## cami

Why not

```
config_enp5s3="10.215.144.91/22 10.215.144.6/22 192.168.144.91/24"

routes_enp5s3="

10.215.246.0/23 dev enp5s3 proto kernel scope link src 10.215.144.91 metric 1

10.215.248.0/24 dev enp5s3 proto kernel scope link src 10.215.144.91 metric 1

192.168.250.0/24 gw 10.215.147.115

192.168.251.0/24 gw 10.215.147.115

"
```

I'm positive that would work as intended.

----------

