Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
978 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs
  réseaux et sécurité

  OpenWRT et iptables : autoriser une connexion à un VPN externe

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

OpenWRT et iptables : autoriser une connexion à un VPN externe

n°1237813
guepe
J'ai du noir sur la truffe ?
Posté le 15-09-2010 à 00:43:30  profilanswer
 

J'utilise un routeur avec openwrt d'installer : tout fonctionne bien pour moi, cependant aucune des machines dans le réseau ne peut se connecter à un serveur VPN (pptp, windows) externe.

 

C'est d'après mes frénétiques recherches un problème de firewall, et la réponse la plus pertinente que j'ai trouvée est : I just add the following rule more.

 

-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

 

(source http://forums.fedoraforum.org/sosa [...] hp?t=63572 )

 

Mais cela dépasse pas mal mes compétences. Auriez-vous des réponses ?

 

[edit]

Code :
  1. root@OpenWrt:/etc# iptables -L
  2. Chain INPUT (policy ACCEPT)
  3. target     prot opt source               destination       
  4. DROP       all  --  anywhere             anywhere            state INVALID
  5. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  6. ACCEPT     all  --  anywhere             anywhere           
  7. syn_flood  tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  8. input_rule  all  --  anywhere             anywhere           
  9. input      all  --  anywhere             anywhere           
  10. Chain FORWARD (policy DROP)
  11. target     prot opt source               destination       
  12. zone_wan_MSSFIX  all  --  anywhere             anywhere           
  13. DROP       all  --  anywhere             anywhere            state INVALID
  14. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  15. forwarding_rule  all  --  anywhere             anywhere           
  16. forward    all  --  anywhere             anywhere           
  17. reject     all  --  anywhere             anywhere           
  18. Chain OUTPUT (policy ACCEPT)
  19. target     prot opt source               destination       
  20. DROP       all  --  anywhere             anywhere            state INVALID
  21. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  22. ACCEPT     all  --  anywhere             anywhere           
  23. output_rule  all  --  anywhere             anywhere           
  24. output     all  --  anywhere             anywhere           
  25. Chain forward (1 references)
  26. target     prot opt source               destination       
  27. zone_lan_forward  all  --  anywhere             anywhere           
  28. zone_wan_forward  all  --  anywhere             anywhere           
  29. Chain forwarding_lan (1 references)
  30. target     prot opt source               destination       
  31. Chain forwarding_rule (1 references)
  32. target     prot opt source               destination       
  33. Chain forwarding_wan (1 references)
  34. target     prot opt source               destination       
  35. Chain input (1 references)
  36. target     prot opt source               destination       
  37. zone_lan   all  --  anywhere             anywhere           
  38. zone_wan   all  --  anywhere             anywhere           
  39. Chain input_lan (1 references)
  40. target     prot opt source               destination       
  41. Chain input_rule (1 references)
  42. target     prot opt source               destination       
  43. Chain input_wan (1 references)
  44. target     prot opt source               destination       
  45. Chain output (1 references)
  46. target     prot opt source               destination       
  47. zone_lan_ACCEPT  all  --  anywhere             anywhere           
  48. zone_wan_ACCEPT  all  --  anywhere             anywhere           
  49. Chain output_rule (1 references)
  50. target     prot opt source               destination       
  51. Chain reject (5 references)
  52. target     prot opt source               destination       
  53. REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
  54. REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
  55. Chain syn_flood (1 references)
  56. target     prot opt source               destination       
  57. RETURN     tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
  58. DROP       all  --  anywhere             anywhere           
  59. Chain zone_lan (1 references)
  60. target     prot opt source               destination       
  61. input_lan  all  --  anywhere             anywhere           
  62. zone_lan_ACCEPT  all  --  anywhere             anywhere           
  63. Chain zone_lan_ACCEPT (2 references)
  64. target     prot opt source               destination       
  65. ACCEPT     all  --  anywhere             anywhere           
  66. ACCEPT     all  --  anywhere             anywhere           
  67. Chain zone_lan_DROP (0 references)
  68. target     prot opt source               destination       
  69. DROP       all  --  anywhere             anywhere           
  70. DROP       all  --  anywhere             anywhere           
  71. Chain zone_lan_MSSFIX (0 references)
  72. target     prot opt source               destination       
  73. TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
  74. Chain zone_lan_REJECT (1 references)
  75. target     prot opt source               destination       
  76. reject     all  --  anywhere             anywhere           
  77. reject     all  --  anywhere             anywhere           
  78. Chain zone_lan_forward (1 references)
  79. target     prot opt source               destination       
  80. zone_wan_ACCEPT  all  --  anywhere             anywhere           
  81. forwarding_lan  all  --  anywhere             anywhere           
  82. zone_lan_REJECT  all  --  anywhere             anywhere           
  83. Chain zone_wan (1 references)
  84. target     prot opt source               destination       
  85. ACCEPT     udp  --  anywhere             anywhere            udp dpts:10001:20000
  86. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:443
  87. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:22
  88. ACCEPT     udp  --  anywhere             anywhere            udp dpt:68
  89. input_wan  all  --  anywhere             anywhere           
  90. zone_wan_REJECT  all  --  anywhere             anywhere           
  91. Chain zone_wan_ACCEPT (2 references)
  92. target     prot opt source               destination       
  93. ACCEPT     all  --  anywhere             anywhere           
  94. ACCEPT     all  --  anywhere             anywhere           
  95. root@OpenWrt:/etc# iptables -L
  96. Chain INPUT (policy ACCEPT)
  97. target     prot opt source               destination       
  98. DROP       all  --  anywhere             anywhere            state INVALID
  99. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  100. ACCEPT     all  --  anywhere             anywhere           
  101. syn_flood  tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  102. input_rule  all  --  anywhere             anywhere           
  103. input      all  --  anywhere             anywhere           
  104. Chain FORWARD (policy DROP)
  105. target     prot opt source               destination       
  106. zone_wan_MSSFIX  all  --  anywhere             anywhere           
  107. DROP       all  --  anywhere             anywhere            state INVALID
  108. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  109. forwarding_rule  all  --  anywhere             anywhere           
  110. forward    all  --  anywhere             anywhere           
  111. reject     all  --  anywhere             anywhere           
  112. Chain OUTPUT (policy ACCEPT)
  113. target     prot opt source               destination       
  114. DROP       all  --  anywhere             anywhere            state INVALID
  115. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  116. ACCEPT     all  --  anywhere             anywhere           
  117. output_rule  all  --  anywhere             anywhere           
  118. output     all  --  anywhere             anywhere           
  119. Chain forward (1 references)
  120. target     prot opt source               destination       
  121. zone_lan_forward  all  --  anywhere             anywhere           
  122. zone_wan_forward  all  --  anywhere             anywhere           
  123. Chain forwarding_lan (1 references)
  124. target     prot opt source               destination       
  125. Chain forwarding_rule (1 references)
  126. target     prot opt source               destination       
  127. Chain forwarding_wan (1 references)
  128. target     prot opt source               destination       
  129. Chain input (1 references)
  130. target     prot opt source               destination       
  131. zone_lan   all  --  anywhere             anywhere           
  132. zone_wan   all  --  anywhere             anywhere           
  133. Chain input_lan (1 references)
  134. target     prot opt source               destination       
  135. Chain input_rule (1 references)
  136. target     prot opt source               destination       
  137. Chain input_wan (1 references)
  138. target     prot opt source               destination       
  139. Chain output (1 references)
  140. target     prot opt source               destination       
  141. zone_lan_ACCEPT  all  --  anywhere             anywhere           
  142. zone_wan_ACCEPT  all  --  anywhere             anywhere           
  143. Chain output_rule (1 references)
  144. target     prot opt source               destination       
  145. Chain reject (5 references)
  146. target     prot opt source               destination       
  147. REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
  148. REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
  149. Chain syn_flood (1 references)
  150. target     prot opt source               destination       
  151. RETURN     tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
  152. DROP       all  --  anywhere             anywhere           
  153. Chain zone_lan (1 references)
  154. target     prot opt source               destination       
  155. input_lan  all  --  anywhere             anywhere           
  156. zone_lan_ACCEPT  all  --  anywhere             anywhere           
  157. Chain zone_lan_ACCEPT (2 references)
  158. target     prot opt source               destination       
  159. ACCEPT     all  --  anywhere             anywhere           
  160. ACCEPT     all  --  anywhere             anywhere           
  161. Chain zone_lan_DROP (0 references)
  162. target     prot opt source               destination       
  163. DROP       all  --  anywhere             anywhere           
  164. DROP       all  --  anywhere             anywhere           
  165. Chain zone_lan_MSSFIX (0 references)
  166. target     prot opt source               destination       
  167. TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
  168. Chain zone_lan_REJECT (1 references)
  169. target     prot opt source               destination       
  170. reject     all  --  anywhere             anywhere           
  171. reject     all  --  anywhere             anywhere           
  172. Chain zone_lan_forward (1 references)
  173. target     prot opt source               destination       
  174. zone_wan_ACCEPT  all  --  anywhere             anywhere           
  175. forwarding_lan  all  --  anywhere             anywhere           
  176. zone_lan_REJECT  all  --  anywhere             anywhere           
  177. Chain zone_wan (1 references)
  178. target     prot opt source               destination       
  179. ACCEPT     udp  --  anywhere             anywhere            udp dpts:10001:20000
  180. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:443
  181. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:22
  182. ACCEPT     udp  --  anywhere             anywhere            udp dpt:68
  183. input_wan  all  --  anywhere             anywhere           
  184. zone_wan_REJECT  all  --  anywhere             anywhere           
  185. Chain zone_wan_ACCEPT (2 references)
  186. target     prot opt source               destination       
  187. ACCEPT     all  --  anywhere             anywhere           
  188. ACCEPT     all  --  anywhere             anywhere           
  189. Chain zone_wan_DROP (0 references)
  190. target     prot opt source               destination       
  191. DROP       all  --  anywhere             anywhere           
  192. DROP       all  --  anywhere             anywhere           
  193. Chain zone_wan_MSSFIX (1 references)
  194. target     prot opt source               destination       
  195. TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
  196. Chain zone_wan_REJECT (2 references)
  197. target     prot opt source               destination       
  198. reject     all  --  anywhere             anywhere           
  199. reject     all  --  anywhere             anywhere           
  200. Chain zone_wan_forward (1 references)
  201. target     prot opt source               destination       
  202. ACCEPT     udp  --  anywhere             192.168.1.3         udp dpts:10001:20000
  203. ACCEPT     tcp  --  anywhere             192.168.1.2         tcp dpt:443
  204. ACCEPT     tcp  --  anywhere             192.168.1.2         tcp dpt:22
  205. forwarding_wan  all  --  anywhere             anywhere           
  206. zone_wan_REJECT  all  --  anywhere             anywhere
 

Merci !


Message édité par guepe le 15-09-2010 à 02:07:56

---------------
Un blog qu'il est bien
mood
Publicité
Posté le 15-09-2010 à 00:43:30  profilanswer
 

n°1237815
black_lord
Modérateur
Truth speaks from peacefulness
Posté le 15-09-2010 à 07:40:41  profilanswer
 

il y a peu de chances que ce soit ça : en effet ta règle est en -j REJECT, ce qui veut dire qu'elle va dropper des paquets et pas en autoriser. En plus la chaine RH-Firewallblah n'existe pas chez toi.
 
J'ai pas relu les rules mais normalement openwrt autorise tout en sortie par défaut.


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°1237962
guepe
J'ai du noir sur la truffe ?
Posté le 15-09-2010 à 16:53:12  profilanswer
 

black_lord a écrit :

il y a peu de chances que ce soit ça : en effet ta règle est en -j REJECT, ce qui veut dire qu'elle va dropper des paquets et pas en autoriser. En plus la chaine RH-Firewallblah n'existe pas chez toi.
 
J'ai pas relu les rules mais normalement openwrt autorise tout en sortie par défaut.


Pourtant, cela ne marche pas… pour aucun VPN que j'ai pu tester. Il doit bien y avoir quelque chose…


---------------
Un blog qu'il est bien
n°1238009
esox_ch
Posté le 16-09-2010 à 08:54:55  profilanswer
 

Poua , quelle bouille ...  
Guepe, tu pourrais éditer ton code? Tu as collé 2x la même chose.
Par contre il y a un truc qui me turlupine ...
 

Code :
  1. # Chain INPUT (policy ACCEPT)
  2. # target     prot opt source               destination     
  3. # DROP       all  --  anywhere             anywhere            state INVALID
  4. # ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
  5. # ACCEPT     all  --  anywhere             anywhere         
  6. # syn_flood  tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  7. # input_rule  all  --  anywhere             anywhere         
  8. # input      all  --  anywhere             anywhere


 
Je ne comprend pas l'utilité de mettre les choses dans cet ordre. Le 1er accept est de toutes façons "englobé" dans le 2ème non?
Et quoi qu'il arrive, le 2ème accept laisse tout passer, donc à quoi servent les lignes suivantes?
 
En plus, perso je trouve surprenant de mettre le INPUT en "policy ACCEPT" :o


---------------
Si la vérité est découverte par quelqu'un d'autre,elle perd toujours un peu d'attrait
n°1238096
guepe
J'ai du noir sur la truffe ?
Posté le 16-09-2010 à 15:57:25  profilanswer
 

C'est la config par défaut de openwrt, vu que je n'ai jamais touché à cela (ça me dépasse !). Bon j'ai ajouté 2 paquets (qui configurent iptables) en rapport avec pptp, c'est tout.
 
Je vais essayer de supprimer ces paquets et de regarder à nouveau la config, plus la rendre propre, ce sera plus clair.


---------------
Un blog qu'il est bien
n°1238117
roondar
Posté le 16-09-2010 à 18:49:27  profilanswer
 

Tu as essayé de désactive ton parefeu ?

n°1238118
guepe
J'ai du noir sur la truffe ?
Posté le 16-09-2010 à 18:54:14  profilanswer
 

roondar a écrit :

Tu as essayé de désactive ton parefeu ?


Non effectivement, ca permettrait au moins de savoir si c'est lui ou pas. Je testerai, en fait c'est une idée qu'elle est simple et qu'elle est bien  :love:


---------------
Un blog qu'il est bien

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs
  réseaux et sécurité

  OpenWRT et iptables : autoriser une connexion à un VPN externe

 

Sujets relatifs
[xrandr] utilisation d'écran externe si connecté ET allumé[Résolu][VPN] error=self signed certificate
problème de collecte de logs iptables[iptables] joindre un point d'accès derrière une Debian.
Problème de connexion reseauSendmail n'evoie que sur les adresse externe
Iptables Openwrt plusieur interface[Ubuntu 10.4] Connexion internet lente
[OpenWRT] fonctionnement et problémes 
Plus de sujets relatifs à : OpenWRT et iptables : autoriser une connexion à un VPN externe


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR