TunSafe Forum

Welcome to the TunSafe Community Forum. This is open for discussions related to TunSafe and the WireGuard protocol.

You are not logged in.

#1 2019-05-07 11:13:58

yongsiklee
Member
Registered: 2019-05-07
Posts: 4

Connection only for peer to peer. No internet on Windows.

Hi,

I was able to make Tunsafe work but only for peer to peer connection.

I installed Wireguard in Ubuntu server and connection was established from my Windows 7 peer.
But as soon as connection established, my Windows internet is disconnected.
On Windows, after connecting, I see another network is live as Tap Driver network in addition to my existing network.
And I see it has no internet/network connection. But I can ping my Ubuntu server and do SSH, etc.

Why do I lose my Windows internet connection as soon as I connect to my Wireguard server thru Tunsafe?

Offline

#2 2019-05-07 11:27:32

yongsiklee
Member
Registered: 2019-05-07
Posts: 4

Re: Connection only for peer to peer. No internet on Windows.

I forgot to post config file:

First, this is server config:

[Interface]
Address = = 10.200.200.1/24
SaveConfig = true

ListenPort = 5555
PrivateKey = hfdgfdsgsgds.....

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o$
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING $

[Peer]
PublicKey =gfsgstgesw....
AllowedIPs = 10.200.200.2/32



This is config from peer (Windows) Tunsafe config:

# This is a sample config file for TunSafe. It uses the same syntax as
# WireGuard's wg-quick tool

[Interface]

# The private key of this computer. This is a secret key, don't give it out.
# To convert it to a public key you can go to 'Generate Key Pair' in TunSafe.
PrivateKey = gshthfdfdgTSDFGgsdgs....

# Whether we want to bind a port to allow others to initiate connections to us.
# Please ensure this port is mapped in your router.
# ListenPort = 51820

# Switch DNS server while connected
# DNS = 8.8.8.8
DNS = 10.200.200.1

# The addresses to bind to. Either IPv4 or IPv6. /31 and /32 are not supported.
Address = 10.200.200.2/24

# Whether to block all access to Internet that doesn't go through tunsafe.
# Note that Internet will keep being blocked even after TunSafe is restarted.
# Possible values (comma separated):
#  route - Blocks all traffic using null route entries
#  firewall - Blocks all traffic except TunSafe through the Windows firewall
#  on - Uses the default block mechanism
#  off - Turns off blocking
# BlockInternet = route, firewall

[Peer]
# The public key of the peer. Do not use the private key here. Use the 'Generate Key Pair'
# function in TunSafe to convert a private key to a public key.
PublicKey = gdsagdsfdssGDSFDS.....

# It's also possible to use a preshared key for extra security
# PresharedKey  =  SNz4BYc61amtDhzxNCxgYgdV9rPU+WiC8woX47Xf/2Y=

# The IP range that we may send packets to for this peer.

AllowedIPs = 0.0.0.0/0, ::/0

# Address of the server
Endpoint = X.X.X.x:51820

# Send periodic keepalives to ensure connection stays up behind NAT.
PersistentKeepalive = 25

Offline

#3 2019-05-07 13:19:18

hybtoy
Member
Registered: 2018-07-05
Posts: 24

Re: Connection only for peer to peer. No internet on Windows.

PostUp   = iptables -A FORWARD -i tun0 -j ACCEPT; iptables -A FORWARD -o tun0 -j ACCEPT; iptables -t nat -A POSTROUTING -o $eth -j MASQUERADE
PostDown = iptables -D FORWARD -i tun0 -j ACCEPT; iptables -D FORWARD -o tun0 -j ACCEPT; iptables -t nat -D POSTROUTING -o $eth -j MASQUERADE

replace $eth with your main interface

Last edited by hybtoy (2019-05-07 13:19:53)

Offline

#4 2019-05-07 20:44:45

yongsiklee
Member
Registered: 2019-05-07
Posts: 4

Re: Connection only for peer to peer. No internet on Windows.

I tried that but not working.

The connection has been established but the problem is as soon as tunsafe is connected, my network adds another local area network, local area 2 with Tap-Windows Adapter A9, which has NO Network/Internet connection, and I get disconnected from the internet.
But tunsafe is still working with peer to peer connection.

Offline

#5 2019-05-09 10:14:27

hybtoy
Member
Registered: 2018-07-05
Posts: 24

Re: Connection only for peer to peer. No internet on Windows.

yongsiklee wrote:

# Switch DNS server while connected
# DNS = 8.8.8.8
DNS = 10.200.200.1

# Switch DNS server while connected
DNS = 8.8.8.8
#DNS = 10.200.200.1

try to change DNS in client config and try again.

Offline

#6 2019-05-11 12:53:55

yongsiklee
Member
Registered: 2019-05-07
Posts: 4

Re: Connection only for peer to peer. No internet on Windows.

Thank you. Now it works!

hybtoy wrote:
yongsiklee wrote:

# Switch DNS server while connected
# DNS = 8.8.8.8
DNS = 10.200.200.1

# Switch DNS server while connected
DNS = 8.8.8.8
#DNS = 10.200.200.1

try to change DNS in client config and try again.

Offline

Board footer

Powered by FluxBB