Bonjour,
Pour réaliser une seedbox, j'ai repris ce vieux tutoriel (
https://mondedie.fr/d/5933-tuto-faire-p … unnnel-vpn) que j'ai dû adapter à ma configuration.
Donc, comme j'ai un réseau local 192.168.0.x :
- j'ai créé l'interface
auto lo:1
iface lo:1 inet static
address 192.168.1.1
netmask 255.255.255.255- j'ai adapté le script up.sh :
iptables -N SERVICES
NET_DEV="tun0"
NET_IP="$(command ip -o addr | command grep "${NET_DEV}" | command grep 'inet ' | command sed 's/^.inet ([^ ]) .*$/\1/')"
ip route add default dev tun0 table VPN
ip rule add from 192.168.1.1/32 table VPN
ip rule add from ${NET_IP}/32 table VPN
iptables -A PREROUTING -t nat -i tun0 -p tcp --dport 51413 -j DNAT --to 192.168.1.1
iptables -A PREROUTING -t nat -i tun0 -p udp --dport 51413 -j DNAT --to 192.168.1.1
iptables -A POSTROUTING -t nat -o tun0 -j MASQUERADE
iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A SERVICES -p tcp --dport 51413 -j ACCEPT
iptables -A SERVICES -p udp --dport 51413 -j ACCEPT
iptables -A FORWARD -s 192.168.1.1/32 -o enp3s0 -j DROPEt malgré cela, le téléchargement ne fonctionne pas ! (alors que, si je ne lance pas OpenVPN, Transmission fonctionne parfaitement)
Voici l'état de mon réseau :
ip rule show0: from all lookup local
32761: from 10.12.0.178 lookup VPN
32762: from 192.168.1.1 lookup VPN
32763: from 10.12.0.197 lookup VPN
32764: from 10.12.0.198 lookup VPN
32765: from 192.168.1.1 lookup VPN
32766: from all lookup main
32767: from all lookup default
echo $NET_IP10.12.0.198
iptables -t filter --listChain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DROP all -- HTPC anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain SERVICES (0 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:51413
ACCEPT udp -- anywhere anywhere udp dpt:51413
netstat -rnTable de routage IP du noyau
Destination Passerelle Genmask Indic MSS Fenêtre irtt Iface
0.0.0.0 10.12.0.177 0.0.0.0 UG 0 0 0 tun0
10.12.0.177 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
51.68.152.226 192.168.0.254 255.255.255.255 UGH 0 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlp2s0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp2s0
Est-ce que quelqu'un a une idée de solution ?
D'avance merci.