Programmable Internetworking & Communication Operating System Docs ... Click Spaces -> Space Directory to see docs for all releases ...
Page tree
Skip to end of metadata
Go to start of metadata

Networking Requirements

Figure 1. Networking for configuring OSPF to introduce routing

As shown in Figure 1, there are four switches in the network which need to communicate with each other, and the entire network can be extended using the area where Switch B and Switch C are located as ABRs in the backbone area. On Switch C, introduce the static routes into OSPF route by exporting a routing policy.

Follow the configuration roadmap below to complete the configurations.

 1.  Configure the basic OSPF functions.

  • Configure VLANs and VLAN interfaces, and configure the IP address for each VLAN interface to implement communication within the network segments.
  • The basic functions of OSPF are configured on each switch, and the OSPF network is divided into area 0.0.0.0, area 1.1.1.1 and area 2.2.2.2 with switch B and switch C as the ABRs. Configure basic OSPF functions on each switch. Configure Switch B and Switch C as the ABR into divide the OSPF network to three areas: area 0.0.0.0, area 1.1.1.1 and area 2.2.2.2.

2.  Configure routing policy to accept static route on switch C, and use OSPF export the policy to introduce static routes into OSPF protocol.

3.  By checking the routing table on switch A, you can see that the static routes configured on switch C have been introduced into the routing table on switch A through OSPF route advertisement.

Procedure

SwitchA

Step1         Configure VLANs and VLAN interfaces.

admin@SwitchA# set vlans vlan-id 500 l3-interface vlan-500
admin@SwitchA# set vlan-interface interface vlan-500 vif vlan-500 address 192.168.1.2 prefix-length 30
admin@SwitchA# set interface gigabit-ethernet ge-1/1/47 family ethernet-switching native-vlan-id 500

Step2         Configure basic OSPF functions.

admin@SwitchA# set protocols ospf4 router-id 1.1.1.1
admin@SwitchA# set protocols ospf4 area 1.1.1.1 interface vlan-500 vif vlan-500 address 192.168.1.2

Step3         Commit the configurations.

admin@SwitchA# commit

SwitchB

Step1         Configure VLANs and VLAN interfaces.

admin@SwitchB# set vlans vlan-id 400 l3-interface vlan-400 
admin@SwitchB# set vlan-interface interface vlan-400 vif vlan-400 address 172.25.150.250 prefix-length 30
admin@SwitchB# set vlans vlan-id 500 l3-interface vlan-500
admin@SwitchB# set vlan-interface interface vlan-500 vif vlan-500 address 192.168.1.1 prefix-length 30
admin@SwitchB# set interface gigabit-ethernet ge-1/1/48 family ethernet-switching native-vlan-id 500
admin@SwitchB# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 400

Step2         Configure basic OSPF functions.

admin@SwitchB# set protocols ospf4 router-id 4.4.4.4
admin@SwitchB# set protocols ospf4 area 1.1.1.1 interface vlan-500 vif vlan-500 address 192.168.1.1
admin@SwitchB# set protocols ospf4 area 0.0.0.0 interface vlan-400 vif vlan-400 address 172.25.150.250

Step3         Commit the configurations.

admin@SwitchB# commit

SwitchC

Step1         Configure VLANs and VLAN interfaces.

admin@SwitchC# set vlans vlan-id 300 l3-interface vlan-300
admin@SwitchC# set vlan-interface interface vlan-300 vif vlan-300 address 172.25.150.246 prefix-length 30
admin@SwitchC# set vlans vlan-id 400 l3-interface vlan-400
admin@SwitchC# set vlan-interface interface vlan-400 vif vlan-400 address 172.25.150.249 prefix-length 30
admin@SwitchC# set interface gigabit-ethernet ge-1/1/49 family ethernet-switching native-vlan-id 300
admin@SwitchC# set interface gigabit-ethernet ge-1/1/51 family ethernet-switching native-vlan-id 400

Step2         Configure basic OSPF functions.

admin@SwitchC# set protocols ospf4 router-id 3.3.3.3
admin@SwitchC# set protocols ospf4 area 2.2.2.2 interface vlan-300 vif vlan-300 address 172.25.150.246
admin@SwitchC# set protocols ospf4 area 0.0.0.0 interface vlan-400 vif vlan-400 address 172.25.150.249

Step3         Configure external static route.

admin@SwitchC# set protocols static route 192.168.6.0/24 next-hop 172.25.150.245

Step4         Configure policy to import external route.

admin@SwitchC# set policy policy-statement static term 1 from protocol static
admin@SwitchC# set policy policy-statement static then accept

Step5         Apply the policy on OSPF.

admin@SwitchC# set protocols ospf4 export static

Step6         Commit the configurations.

admin@SwitchC# commit

SwitchD

Step1         Configure VLANs and VLAN interfaces.

admin@SwitchD# set vlans vlan-id 300 l3-interface vlan-300
admin@SwitchD# set vlan-interface interface vlan-300 vif vlan-300 address 192.168.1.2 prefix-length 30
admin@SwitchC# set vlan-interface interface vlan-300 vif vlan-300 address 172.25.150.2 prefix-length 30
admin@SwitchD# set interface gigabit-ethernet ge-1/1/49 family ethernet-switching native-vlan-id 300

Step2         Configure basic OSPF functions.

admin@SwitchD# set protocols ospf4 router-id 5.5.5.5
admin@SwitchD# set protocols ospf4 area 2.2.2.2 interface vlan-300 vif vlan-300 address 172.25.150.2

Step3         Commit the configurations.

admin@SwitchD# commit

Verify the Configuration

  • Check routing table on Switch A, we can find route entry 192.168.6.0/24 in the table.
admin@SwitchA# commit
admin@SwitchA# run show route forward-route ipv4 all
Destination           NextHopMac             Port   
---------------        -----------------         ---------
192.168.1.0/30        C8:0A:A9:AE:0A:66   connected
172.25.150.248/30   60:EB:69:9B:BE:31    ge-1/1/47
192.168.6.0/24        60:EB:69:9B:BE:31    ge-1/1/47
Total route count:3
  • No labels