mirror of
https://github.com/net-byte/vtun
synced 2024-03-14 10:50:03 +08:00
update docs
This commit is contained in:
parent
d46298da98
commit
5e21c80a47
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user