Community discussions

MikroTik App
 
northtiger
just joined
Topic Author
Posts: 3
Joined: Tue Dec 06, 2022 11:39 am

WIreguard connection broken after power outage

Tue Dec 06, 2022 12:01 pm

Hi!
I use my hAP ac2 as wireguard client. I have 2 endpoints: Ubuntu server and Keneetik router. Both worked well. But the connection to the Keenetic ceased to be established after a power outage and a reboot my hAP. The connection to the Ubuntu server works well. I can connect to the Keneetic with destktop or mobile wireguard app with same config. But when connecting Mikrotik, only outgoing handshakes go. Rx traffic is 0 B, Tx is n*148 B. My hAP got a different ip from DHCP after a reboot. Can be trouble cause with DHCP?
Maybe more information is needed? Configs, etc?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19111
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: WIreguard connection broken after power outage

Tue Dec 06, 2022 6:25 pm

Read Para 6 . - viewtopic.php?t=182340
 
northtiger
just joined
Topic Author
Posts: 3
Joined: Tue Dec 06, 2022 11:39 am

Re: WIreguard connection broken after power outage

Tue Dec 06, 2022 10:59 pm

Read Para 6 . - viewtopic.php?t=182340
TY for manual. P6 is for endpoint's dynamic IP. But my both endpoints have public IP. Connection to ubuntu endpoint works well. Connection to keenetic don't work. I dont recieve handshake. But connetcion to keenetic works well before power outage. My MT router is behind provider's router. Something went wrong after reboot provider's router and MT
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19111
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: WIreguard connection broken after power outage

Tue Dec 06, 2022 11:02 pm

So can you confirm you have access to the providers router in front of the MT, in other words, you can port forward the listening port of the wireguard to the LANIP of the Mikrotik router on the ISPs LAN?? If not, then the MT is solely a client device.
 
northtiger
just joined
Topic Author
Posts: 3
Joined: Tue Dec 06, 2022 11:39 am

Re: WIreguard connection broken after power outage

Tue Dec 06, 2022 11:08 pm

So can you confirm you have access to the providers router in front of the MT, in other words, you can port forward the listening port of the wireguard to the LANIP of the Mikrotik router on the ISPs LAN?? If not, then the MT is solely a client device.
I have not access to providers router. MT is a client device
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19111
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: WIreguard connection broken after power outage

Wed Dec 07, 2022 12:36 am

So right now you have no remote access to the MT because WG is broken.
Tis why I also use SSTP from wireguard as a backup..........

NO, PARA 6 is for the CLIENT!!!
The scripts are for the MT Client Router.....
Suggest use this script and run it every 10 minutes....

Code: Select all
:foreach i in=[/interface/wireguard/peers/find where disabled=no endpoint-address~"[a-z]\$"] do={
  :local LastHandshake [/interface/wireguard/peers/get $i last-handshake]
  :if (([:tostr $LastHandshake] = "") or ($LastHandshake > [:totime "5m"])) do={
    /interface/wireguard/peers/set $i endpoint-address=[/interface/wireguard/peers/get $i endpoint-address]
  }
}

Who is online

Users browsing this forum: BioMax, VinceKalloe and 47 guests