- Tunnel Internet traffic through a Windows 7 PC, using OpenVPN server mode. Traffic can be tunneled from any OpenVPN client.
- This example assumes that you already know how to install OpenVPN and setup keys and/or certificates. For the scope of this example, information about key and certificate management will not be provided.
- We'll setup a server.ovpn, a client.ovpn, and some Windows 7 tweaks.
server.ovpn
Code: Select all
port 1194
proto udp
dev tun
server 10.0.0.0 255.255.255.0 #you may choose any subnet. 10.0.0.x is used for this example.
ca ca.crt #certs are optional. you may choose to go with keys or passwords instead.
cert server_win7.crt
key server_win7.key
dh dh1024.pem
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
#the following commands are optional
keepalive 10 120
comp-lzo
persist-key
persist-tun
verb 3
#last updated May 29, 2011
Code: Select all
client
dev tun
proto udp
remote ip.of.win7.server 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
comp-lzo
verb 3
explicit-exit-notify 2
ping 10
ping-restart 60
route-method exe
route-delay 2
#last updated June 04, 2011
Code: Select all
Start -> Right-click My Computer -> Manage
Services
Right-click Routing and Remote Access -> Properties -> Automatic
Right-click Routing and Remote Access -> Start
Next:
Control Panel
Network and Sharing Center
Local Area Connection
Properties
Sharing
Tick the box "Allow other network users to connect through this computer's Internet connection"
From the drop-down list select "Local Area Connection 2", or whatever is the connection name of your TAP server connection.
regedit
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Value: IPEnableRouter
Type: REG_DWORD
Data: 0x00000001 (1)
- Further tweaking and streamlining may be possible.
- Thank you to Krzee for the register-dns tweak