0

Could someone help me to figure out a weird issue?

Wireguard server ip: 192.168.1.100
wg0 private address block: 192.168.4.0/24
Server with all services & (listening ports): 192.168.1.200 (10000,20000,30000)

Basically, I set up a Wireguard VPN server at the office yesterday and everything worked perfectly while testing it at the office. I could connect to the specified services (ports 10000,20000,30000) at the specified ip in lan 192.168.1.200 without issues and everything else was dropped, as I want it.

Then I went home and tested the tunnel. For some reason I could no longer connect to the service listening in port 30000, while the other 2 still worked.

Today, I went to work and used my phone's internet connection to try the tunnel, and I could again connect to all the services. Now again at home, using my phone's internet connection, the service in port 30000 doesn't respond.

I'm guessing this is an issue with iptables, but I really don't know.

My current rules are:

iptables -t nat -I POSTROUTING 1 -s 192.168.4.0/24 -o enp0s3 -j MASQUERADE
iptables -I INPUT 1 -i wg0 -j ACCEPT
iptables -I FORWARD 1 -i enp0s3 -o wg0 -j ACCEPT
iptables -I FORWARD 1 -i wg0 -o enp0s3 -p tcp -d 192.168.1.200 --multi multiport --dports 10000,20000,30000 -j ACCEPT
iptables -I INPUT 1 -i enp0s3 -p udp --dport {wg listen port} -j ACCEPT 

(I wrote these rules here from memory. Any possible typos aren't present on the server)

And maybe the weirdest thing of all -- I had a colleague try the tunnel from home yesterday and he had the same issue -- he couldn't connect to the service at port 30000 while the other 2 worked... Today, after I had successfully connected to the service from work with my phone's internet, I asked him to try again and he also successfully connected to it from home.

The service at port 30000 is mongodb

Thanks.


Now even the services in ports 10000 and 20000 don't work properly for my colleague. He can log in to them, but the queries either return nothing or only a partial reply.

For me all services have worked perfectly all day today..

Could this be a NAT issue? Please :)

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
J. Doe
  • 1
  • 1
  • Now it's working again perfectly from home using my phone's internet connection. Earlier it didn't. I did restart my computer though. After that it started working.. – J. Doe Dec 03 '20 at 21:34

0 Answers0