Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
howto:utiliser_la_connexion_vpn_de_la_brique_en_filaire [2017/09/23 17:32] emile created |
howto:utiliser_la_connexion_vpn_de_la_brique_en_filaire [2017/09/25 17:51] emile [Phase B - Configurer la brique] |
||
---|---|---|---|
Line 1: | Line 1: | ||
=====Utiliser le VPN de la brique sur la connexion filaire===== | =====Utiliser le VPN de la brique sur la connexion filaire===== | ||
- | Note: Ce tuto à été fait sur un réseau de type Livebox mais il est certainement aisé de faire la même chose dans un réseau d'un opérateur concurrent. | + | Note: Ce tuto a été réalisé sur un réseau de type Livebox mais il est certainement aisé de faire la même chose sur un réseau d'un autre opérateur mainstream. |
====Phase A - "Désactiver" la Livebox==== | ====Phase A - "Désactiver" la Livebox==== | ||
- | Pour commencer il nous faut desactiver le dhcp de la livebox. Pour cela il faut aller dans 'configuration avancé', puis 'Configuration réseau', puis 'DHCP', pour avoir le bouton "désactiver". | + | Pour commencer il nous faut désactiver le dhcp de la livebox. Pour cela il faut aller dans 'configuration avancé', puis 'Configuration réseau', puis 'DHCP', pour avoir le bouton "désactiver". |
{{:howto:dhcp.png}} | {{:howto:dhcp.png}} | ||
Line 85: | Line 85: | ||
#!/bin/bash | #!/bin/bash | ||
+ | | ||
case "${1}" in | case "${1}" in | ||
start) | start) | ||
Line 92: | Line 92: | ||
ip6tables -w -I FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ip6tables -w -I FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
ip6tables -w -I FORWARD -i eth0 -o tun0 -j ACCEPT | ip6tables -w -I FORWARD -i eth0 -o tun0 -j ACCEPT | ||
+ | ip6tables -w -I FORWARD -i eth0 -o wlan0 -j ACCEPT | ||
+ | ip6tables -w -I FORWARD -i wlan0 -o eth0 -j ACCEPT | ||
ip6tables -w -I INPUT -i eth0 -j ACCEPT | ip6tables -w -I INPUT -i eth0 -j ACCEPT | ||
ip6tables -w -I OUTPUT -o eth0 -j ACCEPT | ip6tables -w -I OUTPUT -o eth0 -j ACCEPT | ||
Line 99: | Line 101: | ||
iptables -w -I FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | iptables -w -I FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
iptables -w -I FORWARD -i eth0 -o tun0 -j ACCEPT | iptables -w -I FORWARD -i eth0 -o tun0 -j ACCEPT | ||
+ | iptables -w -I FORWARD -i eth0 -o wlan0 -j ACCEPT | ||
+ | iptables -w -I FORWARD -i wlan0 -o eth0 -j ACCEPT | ||
iptables -w -I INPUT -i eth0 -j ACCEPT | iptables -w -I INPUT -i eth0 -j ACCEPT | ||
+ | iptables -w -I OUTPUT -o eth0 -j ACCEPT | ||
;; | ;; | ||
stop) | stop) | ||
Line 106: | Line 111: | ||
ip6tables -w -D FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ip6tables -w -D FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
ip6tables -w -D FORWARD -i eth0 -o tun0 -j ACCEPT | ip6tables -w -D FORWARD -i eth0 -o tun0 -j ACCEPT | ||
+ | ip6tables -w -D FORWARD -i eth0 -o wlan0 -j ACCEPT | ||
+ | ip6tables -w -D FORWARD -i wlan0 -o eth0 -j ACCEPT | ||
ip6tables -w -D INPUT -i eth0 -j ACCEPT | ip6tables -w -D INPUT -i eth0 -j ACCEPT | ||
ip6tables -w -D OUTPUT -o eth0 -j ACCEPT | ip6tables -w -D OUTPUT -o eth0 -j ACCEPT | ||
Line 113: | Line 120: | ||
iptables -w -D FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | iptables -w -D FORWARD -i tun0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
iptables -w -D FORWARD -i eth0 -o tun0 -j ACCEPT | iptables -w -D FORWARD -i eth0 -o tun0 -j ACCEPT | ||
+ | iptables -w -D FORWARD -i eth0 -o wlan0 -j ACCEPT | ||
+ | iptables -w -D FORWARD -i wlan0 -o eth0 -j ACCEPT | ||
iptables -w -D INPUT -i eth0 -j ACCEPT | iptables -w -D INPUT -i eth0 -j ACCEPT | ||
+ | iptables -w -D OUTPUT -o eth0 -j ACCEPT | ||
;; | ;; | ||
*) | *) | ||
Line 120: | Line 130: | ||
;; | ;; | ||
esac | esac | ||
+ | |||
+ | Puis on fait en sorte que tout démarre au boot: | ||
+ | |||
+ | systemctl daemon-reload | ||
+ | systemctl enable wiredgw.service | ||
C'est à peu près tout :) on peut rebooter notre brique pour voir si ça fonctionne bien! | C'est à peu près tout :) on peut rebooter notre brique pour voir si ça fonctionne bien! | ||
+ | ====Phase C - Bonus: IP fixe sur le lan==== | ||
+ | |||
+ | Si vous voulez mettre des IP fixes dans votre lan (imprimante, mediacenter) vous pouvez ajouter des options à dnsmasq comme ceci: | ||
+ | |||
+ | dhcp-host=00:10:xx:xx:xx:xx,imprimante,fe80::baba | ||
+ | Et/ou en v4 | ||
+ | dhcp-host=00:10:xx:xx:xx:xx,imprimante,192.168.1.3 | ||