13 lines
239 B
Bash
13 lines
239 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
|
||
|
|
# create tun device
|
||
|
|
ip tuntap add dev tun0 mode tun
|
||
|
|
|
||
|
|
# add ip addr for tun device
|
||
|
|
ip addr add 192.168.3.11/24 dev tun0
|
||
|
|
|
||
|
|
# kernel open ip forward
|
||
|
|
echo 1 > /proc/sys/inet/ipv4/ip_forward
|
||
|
|
|
||
|
|
# start up tun0
|
||
|
|
ifconfig tun0 up
|