Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[reseau] routes statiques
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
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Wed Jan 05, 2005 4:44 pm    Post subject: [reseau] routes statiques Reply with quote

Bonjour,

J'ai installé une deuxiéme carte réseau sur lon poste. Pour lui affecter un adresse IP : pas de bleme :)
En revanche, je voudrais que certaine adresses soient routées par cette carte et d'autres adresses par la premiere carte; je voudrais faire un genre de route add -net xxxxx etc.
Mais je voudrais le faire une fois pour toute, et non à chaque fois que je me logue.
ajouter la ligne qui va bien dans rc.conf/net me semble la bonne manière : mais qu'y mettre ?
Code:
routes_eth1="192.9.9.0 broadcast 192.9.9.255 netmask 255.255.255.0"

ca ne marche pas et je n'arrive pas à trouver de la doc sur le sujet, sauf une syntaxe qui me parait "deprecated"
Code:
routes_eth0=(
   "default via 192.168.5.1"
)

Quid ?
Merci.


Last edited by lbr on Fri Jan 07, 2005 10:18 am; edited 2 times in total
Back to top
View user's profile Send private message
Pachacamac
Veteran
Veteran


Joined: 22 Nov 2003
Posts: 1264
Location: Paris - France

PostPosted: Wed Jan 05, 2005 7:42 pm    Post subject: Reply with quote

Pourquoi tu ne fais pas toi même ton script pour qu'il se lance quand tu le désires ?
Back to top
View user's profile Send private message
Polo
l33t
l33t


Joined: 27 Jan 2004
Posts: 649
Location: Angers, France

PostPosted: Wed Jan 05, 2005 7:47 pm    Post subject: Reply with quote

ouai, tu peux ajouter les commandes que tu fait a chaque fois dans /etc/conf.d/local.start
c'est fait pour ca !! :)
Back to top
View user's profile Send private message
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Thu Jan 06, 2005 1:33 pm    Post subject: Reply with quote

Apparemment y'a pas de solution made in Gentoo :(
Alors je vais me bidouiller un script qui va bien ...
Back to top
View user's profile Send private message
Pachacamac
Veteran
Veteran


Joined: 22 Nov 2003
Posts: 1264
Location: Paris - France

PostPosted: Thu Jan 06, 2005 3:12 pm    Post subject: Reply with quote

Oui, c'est ce qu'il faut faire.
Ils sont en général bien commenté, sinon tu as de la doc sur le site officiel.
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


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

PostPosted: Thu Jan 06, 2005 4:40 pm    Post subject: Reply with quote

Heu, je vois pas vraiment le problème.... Chez moi, j'utilise ça :
Code:
routes_eth0=(
    "192.168.0.0/16 via 192.168.6.254"
    "193.54.225.74 via 192.168.6.254"
    "193.54.225.85 via 192.168.6.254"
    "193.54.225.81 via 192.168.6.254"
    "193.54.195.212 via 192.168.6.254"
    "default via 192.168.6.33"
    "2001:7a8:2b1b::/48"
    "2000::/3 via 2001:7a8:2b1b::33"
)

Et ça marche très bien, ça fait ce que tu cherche si j'ai bein compris ta demande...
Et petite info, cette syntaxe n'est pas du tout deprecated : c'est la syntaxe iproute2 (et pas net-tools)
_________________
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
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Thu Jan 06, 2005 5:01 pm    Post subject: Reply with quote

Quote:
Et petite info, cette syntaxe n'est pas du tout deprecated : c'est la syntaxe iproute2 (et pas net-tools)

Ok ! j'ai donc lu des conneries sur le net :(
Je vais faire comme toi, ca me parait mieux que le coup du script perso.
Merci
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


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

PostPosted: Thu Jan 06, 2005 5:12 pm    Post subject: Reply with quote

Petite précision : n'oublie pas
Code:
modules_eth0=( "iproute2" )
dans ta conf aussi, sinon il ne reconnaitra pas la syntaxe ;)
_________________
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
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Thu Jan 06, 2005 6:49 pm    Post subject: Reply with quote

Quote:
Petite précision : n'oublie pas
Code:
modules_eth0=( "iproute2" )
dans ta conf aussi, sinon il ne reconnaitra pas la syntaxe Wink

Dans conf.d/net ?
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


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

PostPosted: Thu Jan 06, 2005 7:00 pm    Post subject: Reply with quote

oui oui, au meme endroit que le reste de la conf réseau /etc/conf.d/net
_________________
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
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Fri Jan 07, 2005 10:17 am    Post subject: Reply with quote

Désolé mais ca marche pas ... :(
mon conf.d/net :
Code:
# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0="10.1.2.49 broadcast 10.1.2.255 netmask 255.255.255.0"
iface_eth1="192.168.112.38 broadcast 192.168.112.255 netmask 255.255.255.0"

#Ajout des routes statiques pour XXXX
modules_eth1=( "iproute2" )
routes_eth1=(
        "192.5.60.0/24 via 192.168.112.100
        "192.8.8.0/24 via 192.168.112.100
        "192.9.9.0/24 via 192.168.112.100
        "192.9.10.0/24 via 192.168.112.100
        "192.9.11.0/24 via 192.168.112.100
        "192.7.7.0/24 via 192.168.112.100
)
gateway="eth0/10.1.2.254"


et /etc/init.d/net.eth1 restart :
Code:
 * Bringing eth1 down...                                                                                                       [ ok ] * Bringing eth1 up (192.168.112.38)...                                                                                        [ ok ] *   Adding routes
 *     192.5.60.0/24 via 192.168.112.100
        192.8.8.0/24...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     via...
via: Erreur de repérage du nom de l'hôte cible                                                                                 [ !! ]
 *     192.168.112.100...
SIOCADDRT: Aucun périphérique de ce type                                                                                       [ !! ]
 *     192.9.9.0/24 via 192.168.112.100
        192.9.10.0/24...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     via...
via: Erreur de repérage du nom de l'hôte cible                                                                                 [ !! ]
 *     192.168.112.100...
SIOCADDRT: Aucun périphérique de ce type                                                                                       [ !! ]
 *     192.9.11.0/24 via 192.168.112.100
        192.7.7.0/24...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     via...
via: Erreur de repérage du nom de l'hôte cible                                                                                 [ !! ]
 *     192.168.112.100...
SIOCADDRT: Aucun périphérique de ce type                                                                                       [ !! ]


:?:
Back to top
View user's profile Send private message
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Fri Jan 07, 2005 10:23 am    Post subject: Reply with quote

lbr wrote:
...
routes_eth1=(
"192.5.60.0/24 via 192.168.112.100
"192.8.8.0/24 via 192.168.112.100
"192.9.9.0/24 via 192.168.112.100
"192.9.10.0/24 via 192.168.112.100
"192.9.11.0/24 via 192.168.112.100
"192.7.7.0/24 via 192.168.112.100
)
...
[/code]
et /etc/init.d/net.eth1 restart :

:?:


Lire :
Code:
routes_eth1=(
        "192.5.60.0/24 via 192.142.112.100"
        "192.8.8.0/24 via 192.142.112.100"
        "192.9.9.0/24 via 192.142.112.100"
        "192.9.10.0/24 via 192.142.112.100"
        "192.9.11.0/24 via 192.142.112.100"
        "192.7.7.0/24 via 192.142.112.100"
)

ca ne marche pas avec les quotes fermantes non plus. :
Code:
 * Bringing eth1 down...                                                                                                       [ ok ] * Bringing eth1 up (192.168.112.38)...                                                                                        [ ok ] *   Adding routes
 *     192.5.60.0/24 via 192.168.112.100...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     192.8.8.0/24 via 192.168.112.100...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     192.9.9.0/24 via 192.168.112.100...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     192.9.10.0/24 via 192.168.112.100...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     192.9.11.0/24 via 192.168.112.100...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
 *     192.7.7.0/24 via 192.168.112.100...
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                                                                                [ !! ]
Back to top
View user's profile Send private message
sireyessire
Advocate
Advocate


Joined: 20 Mar 2003
Posts: 2991
Location: back in Paris, France

PostPosted: Fri Jan 07, 2005 10:23 am    Post subject: Reply with quote

lbr wrote:
Désolé mais ca marche pas ... :(
mon conf.d/net :
Code:
# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0="10.1.2.49 broadcast 10.1.2.255 netmask 255.255.255.0"
iface_eth1="192.168.112.38 broadcast 192.168.112.255 netmask 255.255.255.0"

#Ajout des routes statiques pour XXXX
modules_eth1=( "iproute2" )
routes_eth1=(
        "192.5.60.0/24 via 192.168.112.100
        "192.8.8.0/24 via 192.168.112.100
        "192.9.9.0/24 via 192.168.112.100
        "192.9.10.0/24 via 192.168.112.100
        "192.9.11.0/24 via 192.168.112.100
        "192.7.7.0/24 via 192.168.112.100
)
gateway="eth0/10.1.2.254"



faut fermer les guilllemets!!! :wink:

[edit] grillé.
mais sinon tu l'as installé iproute2?
_________________
I never think of the future. It comes soon enough.
Albert Einstein

Try simpler first
Shockley
Back to top
View user's profile Send private message
lbr
Guru
Guru


Joined: 05 Apr 2004
Posts: 503
Location: Paris

PostPosted: Fri Jan 07, 2005 10:38 am    Post subject: Reply with quote

je viens d'emerger iproute2
Pareil :(
il me renvoie la syntaxe à la face :
Code:
Syntaxe: inet_route [-vF] del {-host|-net} Cible[/prefix] [gw Gw] [metric M] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Cible[/prefix] [metric M] reject
       inet_route [-FC] flush      PAS supporté                       
Back to top
View user's profile Send private message
Pachacamac
Veteran
Veteran


Joined: 22 Nov 2003
Posts: 1264
Location: Paris - France

PostPosted: Fri Jan 07, 2005 7:41 pm    Post subject: Reply with quote

Et avec /etc/conf.d/local.start ? Ca marche très bien... mieux ? :P
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