Wireguard: Peer's port mismatches and never do handshake

Started by dsh, November 14, 2021, 08:47:00 AM

Previous topic - Next topic
Hi there.

I am trying to connect my linux device to my opnserver. Unfortunately my linux device's port never matches and thus never do handshake.

OPNsense config



Endpoint config


Linux device wg0.conf



First I have tried without ListenPort, thus it was running at random port on linux device.

When I see OPN senses config, I see below.



For example in this case it's trying to connect back port 44000.

If I intentionally change to 44000 in Linux device with ListenPort declaration, OPNsense's endpoint's port will change to random port.

What could be the issue. I have allowed 52820 on firewall. Thanks in advance.


What does your outbound NAT rule look like? If you manually created tge NAT rules snd NAT "everything" instead if e.g. "LAN net", that can happen.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)


Not sure what they means hopefully useful for you.




44027 is the port showing in list configuration


You have a public IP in Mongolia? Would not post it here...

Looks like the tunnel is up, according to the last screenshot. Maybe some FW rules missing on WG interface to make traffic flow?
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

OK, so it's the other end that is misbehaving. You need to check the NAT and/or the WireGuard configuration there.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)