Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
1.2 kB
3
Indexable
Never
sysctl -w net.ipv4.ip_forward=1
sysctl -p

ip tuntap add mode tun dev vpns0
ip link set vpns0 up

iptables -t nat -A POSTROUTING -o vpns0 -j MASQUERADE;
iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE; 

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP group default qlen 1000
    link/ether 56:00:04:c4:b9:c3 brd ff:ff:ff:ff:ff:ff
    inet 66.42.108.41/23 brd 66.42.109.255 scope global dynamic noprefixroute enp1s0
       valid_lft 86165sec preferred_lft 86165sec
    inet6 2001:19f0:6001:5689:5400:4ff:fec4:b9c3/64 scope global dynamic noprefixroute
       valid_lft 2591773sec preferred_lft 604573sec
    inet6 fe80::5400:4ff:fec4:b9c3/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: vpns0: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq state DOWN group default qlen 500
    link/none
Leave a Comment