Example for Configuring IS-IS to Interact with BGP
Networking Requirements
As shown in Figure 7-31, Switch A and Switch B belong to the same AS, and the IS-IS neighbor relationship is established between Switch A and Switch B. An EBGP connection is established between Switch B and Switch C. Switch A, Switch B, and Switch C need to communicate with each other. Besides, the metric of routes needs to be changed when AS 65009 sends the routes to AS 65008.
Configuration Roadmap
The configuration roadmap is as follows:
Configure IP addresses for interfaces, and enable IS-IS and BGP to ensure that there are reachable routes inside each AS.
Configure IS-IS and BGP to import routes from each other on Switch B to ensure that there are routes on each network segment. Configure a route-policy to change the metric of imported routes when IS-IS imports BGP routes.
Procedure
- Configure VLANs that each interface belongs to.
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] vlan batch 10 20 [*SwitchB] interface 10ge 1/0/1 [*SwitchB-10GE1/0/1] port link-type trunk [*SwitchB-10GE1/0/1] port trunk allow-pass vlan 10 [*SwitchB-10GE1/0/1] quit [*SwitchB] interface 10ge 1/0/2 [*SwitchB-10GE1/0/2] port link-type trunk [*SwitchB-10GE1/0/2] port trunk allow-pass vlan 20 [*SwitchB-10GE1/0/2] quit [*SwitchB] commit
The configurations of SwitchA and SwitchC are similar to the configuration of SwitchA, and are not provided here.
- Assign the IP addresses for VLANIF interfaces.
[~SwitchB] interface vlanif 10 [*SwitchB-Vlanif10] ip address 10.1.1.2/24 [*SwitchB-Vlanif10] quit [*SwitchB] interface vlanif 20 [*SwitchB-Vlanif20] ip address 10.2.1.1/24 [*SwitchB-Vlanif20] quit [*SwitchB] commit
The configurations of SwitchA and SwitchC are similar to the configuration of SwitchA, and are not provided here.
- Configure basic IS-IS functions.
# Configure SwitchA.
[~SwitchA] isis 1
[*SwitchA-isis-1] network-entity 10.0000.0000.0001.00
[*SwitchA-isis-1] quit
[*SwitchA] interface vlanif 10
[*SwitchA-Vlanif10] isis enable 1
[*SwitchA-Vlanif10] quit
[*SwitchA] commit
# Configure SwitchB.
[~SwitchB] isis 1
[*SwitchB-isis-1] network-entity 10.0000.0000.0002.00
[*SwitchB-isis-1] quit
[*SwitchB] interface vlanif 10
[*SwitchB-Vlanif10] isis enable 1
[*SwitchB-Vlanif10] quit
[*SwitchB] interface vlanif 20
[*SwitchB-Vlanif20] isis enable 1
[*SwitchB-Vlanif20] quit
[*SwitchB] commit
- Establish an EBGP connection.
# Configure SwitchB.
[~SwitchB] bgp 65008 [*SwitchB-bgp] router-id 172.16.1.1 [*SwitchB-bgp] peer 10.2.1.2 as-number 65009 [*SwitchB-bgp] ipv4-family unicast [*SwitchB-bgp-af-ipv4] network 10.2.1.0 255.255.255.0 [*SwitchB-bgp-af-ipv4] commit [~SwitchB-bgp-af-ipv4] quit [~SwitchB-bgp] quit
Configure SwitchC.
[~SwitchC] bgp 65009 [*SwitchC-bgp] router-id 172.16.2.2 [*SwitchC-bgp] peer 10.2.1.1 as-number 65008 [*SwitchC-bgp] ipv4-family unicast [*SwitchC-bgp-af-ipv4] network 10.2.1.0 255.255.255.0 [*SwitchC-bgp-af-ipv4] commit [~SwitchC-bgp-af-ipv4] quit [~SwitchC-bgp] quit
- Configure IS-IS to import BGP routes.
# Configure a static route on SwitchC.
[~SwitchC] ip route-static 192.168.1.1 32 NULL 0
[*SwitchC] commit
# On SwitchC, configure BGP to import the static route.
[~SwitchC] bgp 65009 [~SwitchC-bgp] import-route static [*SwitchC-bgp] quit [*SwitchC] commit
# On SwitchB, configure IS-IS to import the BGP route.
[~SwitchB] isis 1 [~SwitchB-isis-1] import-route bgp [*SwitchB-isis-1] quit [*SwitchB] commit
# View the routing table of SwitchA, and you can see that IS-IS successfully imports BGP route 192.168.1.1/32.
[~SwitchA] display ip routing-table Proto: Protocol Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table: _public_ Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif10 10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 10.1.1.2/32 Direct 0 0 D 10.1.1.2 Vlanif10 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.1/32 ISIS-L2 15 74 D 10.1.1.2 Vlanif10
# On Switch B, configure the AS_Path filter, and apply the filter in route-policy RTC.
[~SwitchB] ip as-path-filter 1 permit 65009 [*SwitchB] route-policy RTC permit node 0 [*SwitchB-route-policy] if-match as-path-filter 1 [*SwitchB-route-policy] apply cost 20 [*SwitchB-route-policy] quit [*SwitchB] commit
# On SwitchB, configure IS-IS to import the BGP route.
[~SwitchB] isis 1 [~SwitchB-isis-1] import-route bgp route-policy RTC [*SwitchB-isis-1] quit [*SwitchB] commit
# View the routing table of SwitchA, and you can see that the AS_Path filter is successfully applied and the cost of imported route 192.168.1.1/32 changes from 74 to 94.
[~SwitchA] display ip routing-table Proto: Protocol Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table: _public_ Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif10 10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10 10.1.1.2/32 Direct 0 0 D 10.1.1.2 Vlanif10 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.1/32 ISIS-L2 15 94 D 10.1.1.2 Vlanif10
- Configure BGP to import IS-IS routes.
[~SwitchB] bgp 65008 [~SwitchB-bgp] import-route isis 1 [*SwitchB-bgp] quit [*SwitchB] commit
# View the routing table of SwitchC, and you can see that BGP successfully imports IS-IS route 10.1.1.0/24.
[~SwitchC] display ip routing-table Proto: Protocol Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table: _public_ Destinations : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 EBGP 255 0 D 10.2.1.1 Vlanif20 10.2.1.0/24 Direct 0 0 D 10.2.1.2 Vlanif10 10.2.1.1/32 Direct 0 0 D 10.2.1.1 Vlanif20 10.2.1.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.1/32 Static 60 0 D 0.0.0.0 NULL0
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 10 # isis 1 network-entity 10.0000.0000.0001.00 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 isis enable 1 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # return
Configuration file of SwitchB
# sysname SwitchB # vlan batch 10 20 # isis 1 network-entity 10.0000.0000.0002.00 import-route bgp route-policy RTC # interface Vlanif10 ip address 10.1.1.2 255.255.255.0 isis enable 1 # interface Vlanif20 ip address 10.2.1.1 255.255.255.0 isis enable 1 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 20 # interface LoopBack0 ip address 172.16.1.1 255.255.255.255 # bgp 65008 router-id 172.16.1.1 peer 10.2.1.2 as-number 65009 # ipv4-family unicast network 10.2.1.0 255.255.255.0 import-route isis 1 peer 10.2.1.2 enable # route-policy RTC permit node 0 if-match as-path-filter 1 apply cost 20 # ip as-path-filter 1 index 10 permit 65009 # return
Configuration file of SwitchC
# sysname SwitchC # vlan batch 20 # interface Vlanif20 ip address 10.2.1.2 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 20 # interface LoopBack0 ip address 172.16.2.2 255.255.255.255 # bgp 65009 router-id 172.16.2.2 peer 10.2.1.1 as-number 65008 # ipv4-family unicast network 10.2.1.0 255.255.255.0 import-route static peer 10.2.1.1 enable # ip route-static 192.168.1.1 255.255.255.255 NULL0 # return