Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[routage ip] supression de règle par défaut (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
sylvain.bonnemaison
Apprentice
Apprentice


Joined: 13 Jan 2008
Posts: 152

PostPosted: Tue Apr 19, 2011 11:32 pm    Post subject: [routage ip] supression de règle par défaut (résolu) Reply with quote

Bonjour,
Je souhaiterai supprimer une régle de routage installée par défaut lors de la configuration des interfaces réseau pour la remplacer par une autre. Est-il possible de faire cela via /etc/conf.d/net ? Comment ?
Merci


Last edited by sylvain.bonnemaison on Wed Apr 20, 2011 8:54 am; edited 1 time in total
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Wed Apr 20, 2011 6:58 am    Post subject: Reply with quote

Bah tu mets la règle que tu veux, d'ailleurs c'est dans la doc (/usr/share/doc/openrc-0.8.2/net.example)
Code:
# cat /etc/conf.d/net
config_eth0="
192.168.6.14/24
2001:7a8:2b1b::14/64
"

routes_eth0="
default via 192.168.6.254
default via 2001:7a8:2b1b::254
"


Maintenant, si tu parles de routes link-local (ip route list scope link), elles ne doivent pas te gêner, il suffit de définir tes règles de routage en les ignorant.
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
sylvain.bonnemaison
Apprentice
Apprentice


Joined: 13 Jan 2008
Posts: 152

PostPosted: Wed Apr 20, 2011 7:39 am    Post subject: Reply with quote

C'est bien une route link-local qui me pose problème.

Voici le résultat de la command "route -n"
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.21.34   192.168.21.253  255.255.255.255 UGH   2      0        0 eth0
192.168.12.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.21.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.21.0    192.168.12.14     255.255.255.0   UG    3      0        0 eth1
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         192.168.12.14     0.0.0.0         UG    3      0        0 eth1

correpodant à la configuration suivante
Code:
modules="iproute2"

config_eth0="192.168.21.253/24"
routes_eth0="192.168.21.34 via 192.168.21.253"
config_eth1="192.168.12.16/24"
routes_eth1="default via 192.168.12.14
192.168.21.0/24 via 192.168.12.14"

Je souhaiterai supprimer la route "192.168.21.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0". Il semble qu'elle soit défini par défaut. Comment la supprimer ?
Back to top
View user's profile Send private message
sylvain.bonnemaison
Apprentice
Apprentice


Joined: 13 Jan 2008
Posts: 152

PostPosted: Wed Apr 20, 2011 8:53 am    Post subject: Reply with quote

J'ai déclarer la fonction postup() dans le fichier de configuration conf.d/net afin de supprimer la route.
Quote:
postup() {
[[ ${IFACE} == "eth0" ]] && {
ip route del 192.168.21.0/24 dev eth0
}
}
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Wed Apr 20, 2011 9:15 am    Post subject: Reply with quote

Quote:
modules="iproute2"

config_eth0="192.168.21.253/32"
routes_eth0="192.168.21.34 via 192.168.21.253"
config_eth1="192.168.12.16/24"
routes_eth1="default via 192.168.12.14"

_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French 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