Community discussions

MikroTik App
 
ITSM
just joined
Topic Author
Posts: 2
Joined: Wed Dec 07, 2022 4:53 pm

Wireguard. How can i seen peer ip in Mikrotik?

Wed Dec 07, 2022 4:59 pm

My mikrotik setting up like wireguard server. Some peers connecting to my mikrotik. But how i can see client(peer) ip , wich connected to wireguard?
 
aoakeley
Member Candidate
Member Candidate
Posts: 170
Joined: Mon May 21, 2012 11:45 am

Re: Wireguard. How can i seen peer ip in Mikrotik?

Sat Dec 10, 2022 2:25 pm

/interface/wireguard/peers/print detail

does that show what you want?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18958
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Wireguard. How can i seen peer ip in Mikrotik?

Sat Dec 10, 2022 4:34 pm

Only the peer IP addresses you identify are allowed to exit the tunnel to hit the MT device.
Only the peer IP addresses you allow in firewall rules will be allowed to enter local subnets or go out local WAN.

USE LOG function for example.
add action=log chain=forward in-interface=wireguard dst-address=local_subnet
add action=accept chain=forward in-interface=wireguard dst-address=local_subnet


Even better...
add action=add-src-to-address-list in-interface=wireguard dst-address=LAN_subnet address-list=TRACKING
add action=accept chain=forward in-interface=wireguard dst-address=local_subnet
 
ITSM
just joined
Topic Author
Posts: 2
Joined: Wed Dec 07, 2022 4:53 pm

Re: Wireguard. How can i seen peer ip in Mikrotik?

Sun Dec 11, 2022 9:58 am

/interface/wireguard/peers/print detail

does that show what you want?
YES! Thanks!
 
paul4
just joined
Posts: 10
Joined: Tue Mar 14, 2017 11:29 pm

Re: Wireguard. How can i seen peer ip in Mikrotik?

Tue Apr 25, 2023 1:26 pm

/interface/wireguard/peers/print detail

does that show what you want?
This doesn't show who is currently connected. It shows all configured peers. How can I see who is currently connected?
 
holvoetn
Forum Guru
Forum Guru
Posts: 5317
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Wireguard. How can i seen peer ip in Mikrotik?

Tue Apr 25, 2023 1:59 pm

WG on itself is not really based on peer IP.
You can do without (but not recommended).

Check last handshake for peers.
The ones frequently moving to zero, are connected one way or the other.

If they send real traffic, that's something else.
 
aoakeley
Member Candidate
Member Candidate
Posts: 170
Joined: Mon May 21, 2012 11:45 am

Re: Wireguard. How can i seen peer ip in Mikrotik?

Sun Apr 30, 2023 5:58 pm

/interface/wireguard/peers/print detail

does that show what you want?
This doesn't show who is currently connected. It shows all configured peers. How can I see who is currently connected?
This will show active peers.
/interface/wireguard/peers/print detail where last-handshake < [:totime "3m"]

Who is online

Users browsing this forum: No registered users and 16 guests