Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
network config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Vieri
Guru
Guru


Joined: 18 Dec 2005
Posts: 526

PostPosted: Tue Sep 15, 2015 2:00 pm    Post subject: network config Reply with quote

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:

Code:
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":

Code:

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

Code:

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

Code:

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:

Code:
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?
Back to top
View user's profile Send private message
cami
n00b
n00b


Joined: 15 Jan 2005
Posts: 36

PostPosted: Mon Sep 21, 2015 6:34 pm    Post subject: Reply with quote

Why not

Code:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum