Kod: Zaznacz cały
[b]enp2s0:[/b] flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 109.xx.xx.xx netmask 255.255.255.0 broadcast 109.xx.xx.xx
[b]enp3s0:[/b] flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255
[b]lo: [/b]flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
[b]tun0:[/b] flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.0 destination 10.8.0.1
Kod: Zaznacz cały
[b]root@debian:~# route -n[/b]
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 109.xx.xx.xx 0.0.0.0 UG 0 0 0 enp2s0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
109.xx.xx.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0
Kod: Zaznacz cały
[b]root@debian:~# iptables -L[/b]
[b]Chain INPUT (policy ACCEPT)[/b]
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:1978
ACCEPT all -- anywhere anywhere
[b]Chain FORWARD (policy ACCEPT)[/b]
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Kod: Zaznacz cały
iptables -t nat -I POSTROUTING 1 -s 10.8.0.0/24 -o enp2s0 -j MASQUERADE
iptables -I INPUT 1 -i tun0 -j ACCEPT
iptables -I FORWARD 1 -i enp2s0 -o tun0 -j ACCEPT
iptables -I FORWARD 1 -i tun0 -o enp2s0 -j ACCEPT
iptables -I INPUT 1 -i enp2s0 -p udp --dport 1978 -j ACCEPT
Poniżej schemat sieci
https://zapodaj.net/plik-3SdSEuAxrS
Dzięki za pomoc ;-)