{"id":8,"date":"2008-04-09T17:10:05","date_gmt":"2008-04-09T15:10:05","guid":{"rendered":"https:\/\/vpn.univ-fcomte.fr\/?p=8"},"modified":"2008-04-10T17:07:12","modified_gmt":"2008-04-10T15:07:12","slug":"probleme-linux-je-perds-ma-route-par-defaut-en-deconnectant-le-vpn","status":"publish","type":"post","link":"https:\/\/vpn.univ-fcomte.fr\/?p=8","title":{"rendered":"Probl\u00e8me linux : je perds ma route par d\u00e9faut en d\u00e9connectant le VPN"},"content":{"rendered":"<p>Lorsque vous effectuez la connexion VPN, les routes sur votre ordinateur ressemblent \u00e0 cela :<br \/>\n<code><small>cri-29:~# route -n<br \/>\nTable de routage IP du noyau<br \/>\nDestination     Passerelle      Genmask         Indic Metric Ref    Use Iface<br \/>\n192.168.255.201 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0<br \/>\n194.57.91.251   192.168.1.254   255.255.255.255 UGH   0      0        0 eth0<br \/>\n192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0<br \/>\n0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0<\/small><\/code><\/p>\n<p>Lors de la d\u00e9connexion, il ne vous reste que :<br \/>\n<code><small>cri-29:~# route -n<br \/>\nTable de routage IP du noyau<br \/>\nDestination     Passerelle      Genmask         Indic Metric Ref    Use Iface<br \/>\n192.168.255.201 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0<br \/>\n194.57.91.251   192.168.1.254   255.255.255.255 UGH   0      0        0 eth0<br \/>\n192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0<br \/>\n<\/small><\/code><br \/>\nLa route par d\u00e9faut a disparu et vous ne pouvez plus aller sur Internet.<br \/>\nPour r\u00e9soudre ce probl\u00e8me, vous pouvez taper manuellement (sous l&rsquo;utilisateur root) :<br \/>\n<code><small>route add default gw 192.168.1.254<\/small><\/code><br \/>\nou utiliser les scripts suivants :<br \/>\n<code><small>\/etc\/ppp\/ip-pre-up<br \/>\n#!\/bin\/sh<br \/>\nPATH=\/usr\/local\/sbin:\/usr\/sbin:\/sbin:\/usr\/local\/bin:\/usr\/bin:\/bin<br \/>\nexport PATH<br \/>\nPPP_IFACE=\"$1\"<br \/>\nPPP_TTY=\"$2\"<br \/>\nPPP_SPEED=\"$3\"<br \/>\nPPP_LOCAL=\"$4\"<br \/>\nPPP_REMOTE=\"$5\"<br \/>\nPPP_IPPARAM=\"$6\"<br \/>\nexport PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM<br \/>\nPPP_TTYNAME=`\/usr\/bin\/basename \"$2\"`<br \/>\nexport PPP_TTYNAME<br \/>\nrun-parts \/etc\/ppp\/ip-pre-up.d \\<br \/>\n--arg=\"$1\" --arg=\"$2\" --arg=\"$3\" --arg=\"$4\" --arg=\"$5\" --arg=\"$6\"<br \/>\nEOF<\/small><\/code><\/p>\n<p><code><small>etc\/ppp\/ip-pre-up.d\/save-defaultroute<br \/>\n#! \/bin\/bash<br \/>\nGW=$(route -n | grep '^0.0.0.0' | tr -s ' ' ' ' | cut -d' ' -f2)<br \/>\n[ -n \"$GW\" ] &amp;&amp; echo $GW &gt; \/tmp\/$PPP_IFACE.defaultroute<br \/>\nexit 0;<\/small><\/code><\/p>\n<p>et <code><small>etc\/ppp\/ip-down.d\/restore-defaultroute<br \/>\n#! \/bin\/sh -e<br \/>\n[ -f \/tmp\/$PPP_IFACE.defaultroute ] || exit 0<br \/>\nGW=$(cat \/tmp\/$PPP_IFACE.defaultroute)<br \/>\nroute add default gw $GW<br \/>\nexit 0;<\/small><\/code><\/p>\n<p>Si vous utilisez xl2tpd, un autre probl\u00e8me se pose pour vous. xl2tpd ne fait pas appel aux scripts de d\u00e9connexion de la session PPP. Il faut donc patcher xl2tpd en utilisant le repository du LIFC par exemple.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lorsque vous effectuez la connexion VPN, les routes sur votre ordinateur ressemblent \u00e0 cela : cri-29:~# route -n Table de routage IP du noyau Destination Passerelle Genmask Indic Metric Ref Use Iface 192.168.255.201 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 194.57.91.251 192.168.1.254 255.255.255.255 UGH 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[5,6,21],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-problemes-utilisateurs","tag-client","tag-linux","tag-route-par-defaut"],"_links":{"self":[{"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8"}],"version-history":[{"count":0,"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpn.univ-fcomte.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}