Skip to main content
JimmyKhern
New Member
November 11, 2024
Solved

How to set wan ip to always uses wan1 ip address

  • November 11, 2024
  • 4 replies
  • 2639 views

Hi All,

 

I have dual wan setup on my fortigate. Is there a way to set the "WAN IP" in the system information that always uses wan1 or wan2 ip? Thanks

 

regards

Jimmy

Best answer by DPadula

Hi JimmyKhern,

 

There is, you just need to change the priority of one of the defaults routes. The article: Technical Note : Setting priority on static default routes to create a primary (preferred) and a secondary path explain how to do that.

If the solution is what you are looking for, mark the topic as solved to help other members to find the same article.

 

Regards

DPadula

4 replies

dingjerry_FTNT
Staff
Staff
November 11, 2024

Hi @JimmyKhern 

 

Could you please show the outputs of this command?

 

# get router info routing-table all

 

You don't have to show all if the table is really long.  I just need the info with the default routes.

JimmyKhern
New Member
November 11, 2024

Hi @dingjerry_FTNT,

 

Below will be the info. Thanks

 

get router info routing-table all
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
V - BGP VPNv4
* - candidate default

Routing table for VRF=0
S* 0.0.0.0/0 [1/0] via 118.200.25.254, wan1, [1/0]
[1/0] via 129.126.196.1, wan2, [1/0]
C 118.200.25.0/24 is directly connected, wan1
C 129.126.196.0/24 is directly connected, wan2

 

regards

 

dingjerry_FTNT
Staff
Staff
November 11, 2024

Hi @JimmyKhern ,

 

Your two default routes have the same distance and the same priority.

 

If you do not want to change the priority, you may try the following:

 

config system fortiguard

set source-ip x.x.x.x  // This is your wan1 interface IP

end

 

Regards,

DPadula
Staff & Editor
DPadulaAnswer
Staff & Editor
November 11, 2024

Hi JimmyKhern,

 

There is, you just need to change the priority of one of the defaults routes. The article: Technical Note : Setting priority on static default routes to create a primary (preferred) and a secondary path explain how to do that.

If the solution is what you are looking for, mark the topic as solved to help other members to find the same article.

 

Regards

DPadula

JimmyKhern
New Member
November 11, 2024

Thanks everyone for your help.