Fortinet black logo

Administration Guide

Sample configuration

Copy Link
Copy Doc ID 0f66c6af-cee6-11eb-97f7-00505692583a:939735
Download PDF

Sample configuration

Here is an example of a BGP routing configuration:

Configure system interfaces

Interface configuration for FortiSwitch 1:

config system interface

edit mgmt

set ip 10.105.7.9 255.255.255.0

set allowaccess ping https http ssh telnet

set type physical

next

edit internal

set type physical

next

edit vlan20-p2

set ip 192.168.2.100 255.255.255.0

set allowaccess ping https http ssh telnet

set vlanid 20

set interface internal

next

edit vlan40-p4

set ip 172.168.111.6 255.255.255.0

set allowaccess ping https http ssh telnet

set vlanid 40

set interface internal

end

config switch interface

edit "port2"

set native-vlan 20

set stp-state disabled

next

edit "port4"

set native-vlan 40

set stp-state disabled

next

edit "internal"

set allowed-vlans 1,20, 40, 4094

set stp-state disabled

next

end

Internal BGP

In this example, the two neighboring switches are in the same autonomous system.

Configuration for FortiSwitch 1:

config router bgp

set as 6500

set router-id 1.2.3.4

config neighbor

edit "172.168.111.5"

set remote-as 6500

next

end

config network

edit 1

set prefix 192.168.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

Configuration for FortiSwitch 2:

config router bgp

set as 6500

set router-id 5.6.7.8

config neighbor

edit "172.168.111.6"

set remote-as 6500

next

end

config network

edit 1

set prefix 10.50.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

External BGP

In this example, the two neighboring switches are in separate autonomous systems.

Configuration for FortiSwitch 1:

config router bgp

set as 6500

set router-id 1.2.3.4

config neighbor

edit "172.168.111.5"

set remote-as 7500

next

end

config network

edit 1

set prefix 192.168.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

Configuration for FortiSwitch 2:

config router bgp

set as 7500

set router-id 5.6.7.8

config neighbor

edit "172.168.111.6"

set remote-as 6500

next

end

config network

edit 1

set prefix 10.50.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

Checking the BGP configuration

Using the following command, you can check the BGP status on the local switch:

# get router info bgp summary

To check the details about the BGP neighbors:

# get router info bgp neighbors

To check the routes learned by BGP, use the following command:

# get router info routing-table details

Sample configuration

Here is an example of a BGP routing configuration:

Configure system interfaces

Interface configuration for FortiSwitch 1:

config system interface

edit mgmt

set ip 10.105.7.9 255.255.255.0

set allowaccess ping https http ssh telnet

set type physical

next

edit internal

set type physical

next

edit vlan20-p2

set ip 192.168.2.100 255.255.255.0

set allowaccess ping https http ssh telnet

set vlanid 20

set interface internal

next

edit vlan40-p4

set ip 172.168.111.6 255.255.255.0

set allowaccess ping https http ssh telnet

set vlanid 40

set interface internal

end

config switch interface

edit "port2"

set native-vlan 20

set stp-state disabled

next

edit "port4"

set native-vlan 40

set stp-state disabled

next

edit "internal"

set allowed-vlans 1,20, 40, 4094

set stp-state disabled

next

end

Internal BGP

In this example, the two neighboring switches are in the same autonomous system.

Configuration for FortiSwitch 1:

config router bgp

set as 6500

set router-id 1.2.3.4

config neighbor

edit "172.168.111.5"

set remote-as 6500

next

end

config network

edit 1

set prefix 192.168.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

Configuration for FortiSwitch 2:

config router bgp

set as 6500

set router-id 5.6.7.8

config neighbor

edit "172.168.111.6"

set remote-as 6500

next

end

config network

edit 1

set prefix 10.50.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

External BGP

In this example, the two neighboring switches are in separate autonomous systems.

Configuration for FortiSwitch 1:

config router bgp

set as 6500

set router-id 1.2.3.4

config neighbor

edit "172.168.111.5"

set remote-as 7500

next

end

config network

edit 1

set prefix 192.168.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

Configuration for FortiSwitch 2:

config router bgp

set as 7500

set router-id 5.6.7.8

config neighbor

edit "172.168.111.6"

set remote-as 6500

next

end

config network

edit 1

set prefix 10.50.2.0 255.255.255.0

next

end

config redistribute "connected"

end

end

end

Checking the BGP configuration

Using the following command, you can check the BGP status on the local switch:

# get router info bgp summary

To check the details about the BGP neighbors:

# get router info bgp neighbors

To check the routes learned by BGP, use the following command:

# get router info routing-table details