β­•VPN Tunneling

Creating New Interface

create an interface on both devices:

#Client side VPN IP
ip addr add 1.1.1.2/32 peer 1.1.1.1 dev tun0 

#Server side VPN IP
ip addr add 1.1.1.1/32 peer 1.1.1.2 dev tun0 

Enable forwarding in Server side:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 1.1.1.2 -o eth0 -j MASQUERADE

Set new route on client side:

route add -net 10.0.0.0/16 gw 1.1.1.1

NETSH (Windows)

netsh interface portproxy add v4tov4 listenport=4455 listenaddress=10.11.0.22 connectport=445 connectaddress=192.168.1.110
netsh advfirewall firewall add rule name="forward_port_rule" protocol=TCP dir=in localip=10.11.0.22 localport=4455 action=allow

test:

smbclient -L 10.11.0.22 --port=4455 --user=Administrator

Last updated