update docs

This commit is contained in:
netbyte 2022-05-19 23:02:57 +08:00
parent d46298da98
commit 5e21c80a47
2 changed files with 11 additions and 4 deletions

View File

@ -102,8 +102,11 @@ sudo ./vtun-linux-amd64 -S -l :3001 -c 172.16.0.1/24 -k 123456
``` ```
sysctl -w net.core.rmem_max=2500000 sysctl -w net.core.rmem_max=2500000
echo 1 > /proc/sys/net/ipv4/ip_forward vi /etc/sysctl.conf
sysctl -p #enable ipv4 and ipv6 forward
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding=1
sysctl -p /etc/sysctl.conf
# Masquerade outgoing traffic # Masquerade outgoing traffic
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
@ -112,6 +115,7 @@ sudo ./vtun-linux-amd64 -S -l :3001 -c 172.16.0.1/24 -k 123456
iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
# Forward everything # Forward everything
iptables -A FORWARD -j ACCEPT iptables -A FORWARD -j ACCEPT
``` ```
## Docker ## Docker

View File

@ -101,8 +101,11 @@ sudo ./vtun-linux-amd64 -S -l :3001 -c 172.16.0.1/24 -k 123456
``` ```
sysctl -w net.core.rmem_max=2500000 sysctl -w net.core.rmem_max=2500000
echo 1 > /proc/sys/net/ipv4/ip_forward vi /etc/sysctl.conf
sysctl -p #enable ipv4 and ipv6 forward
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding=1
sysctl -p /etc/sysctl.conf
# 设置NAT转发流量 # 设置NAT转发流量
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE