Skip to main content
ilmagnifico
New Member
February 22, 2023
Question

Issue with a WireGuard server behind FortiGate

  • February 22, 2023
  • 3 replies
  • 3493 views

Hi,

I'm having issue to access to a Mikrotik router, that is a WireGuard server, behind a FortiGate 60F.

 

IP of 60F is 192.168.113.1, the IP of the Mikrotik is 192.168.113.4, the WireGuard port is 51820, I created a virtual IP on the FG

 

 

SYSFW60F (WireGuard) # show config firewall vip     edit "WireGuard"         set uuid f03ef9d2-b285-51ed-108d-f7e3e193c54a         set extip xx.xx.xx.xx         set mappedip "192.168.113.4"         set extintf "wan1"         set portforward enable         set protocol udp         set extport 51820         set mappedport 51820     next end

 

 

Then a firewall rule with the virtual IP

 

 

SYSFW60F (2) # show config firewall policy     edit 2         set name "WireGuard"         set uuid e023f12c-b1ce-51ed-67ea-7da8d93cead2         set srcintf "wan1"         set dstintf "internal"         set action accept         set srcaddr "all"         set dstaddr "WireGuard"         set schedule "always"         set service "ALL"         set logtraffic all         set nat enable     next end

 

 

But I don't see any traffic using this rule, nor I'm able to get the WireGuard handshake.

 

Any suggestion? 

Thanks

3 replies

abarushka
Staff
Staff
February 22, 2023

Hello,

 

In case NAT is not configured you may consider to collect debug flow traces and try to trigger the issue:

 

diagnose debug flow filter saddr <source IP address>

diagnose debug flow show function-name enable
diagnose debug flow trace start 10

diagnose debug enable

 

and traffic sniffer


diagnose sniffer packet any 'host <source IP address>' 4 0 a

ilmagnifico
New Member
February 22, 2023

I'm behind a NAT, I don't see any traffic from the logs, any other suggestions?

Thanks

abarushka
Staff
Staff
February 22, 2023

Hello,

You may consider to collect debug flow traces and use port as filter and try to trigger the issue:

 

diagnose debug flow filter port 51820
diagnose debug flow show function-name enable
diagnose debug flow trace start 10
diagnose debug enable

 

and traffic sniffer

 

diagnose sniffer packet any 'port 51820' 4 0 a

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.