Example for Configuring OSPF GTSM
Networking Requirements
On the network shown in Figure 5-42, routers run OSPF and GTSM is enabled on RouterA, RouterB, and RouterC.
Configuration Roadmap
The configuration roadmap is as follows:
Configure OSPF.
Enable GTSM on each router and specify a valid TTL range for packets.
Procedure
- Configure an IP address for each interface.
# Configure IP addresses for all interfaces of RouterA.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 255.255.255.0 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ip address 192.168.2.1 255.255.255.0 [RouterA-GigabitEthernet2/0/0] quit [RouterA] interface gigabitethernet 3/0/0 [RouterA-GigabitEthernet3/0/0] ip address 10.1.1.1 255.0.0.0.0 [RouterA-GigabitEthernet3/0/0] quit
The configurations of RouterB, RouterC and RouterD are similar to the configuration of RouterA, and are not mentioned here.
- Configure basic OSPF functions (see Example for Configuring Basic OSPF Functions).
- Configure OSPF GTSM.
# On RouterA, set the maximum valid TTL range for packets from RouterA to other routers is 255 to 255.
[RouterA] ospf valid-ttl-hops 1
# On RouterB, set the maximum valid TTL range for packets from RouterB to other routers is 254 to 255.
[RouterB] ospf valid-ttl-hops 2
# On RouterC, set the maximum valid TTL range for packets from RouterC to other routers is 254 to 255.
[RouterC] ospf valid-ttl-hops 2
- Verify the configuration.
# Check whether OSPF neighbor relationships between routers are successfully established. Take the display of RouterC as an example. The neighbor relationship is Full, indicating that the neighbor relationship is successfully established.
[RouterC] display ospf peer
OSPF Process 1 with Router ID 3.3.3.3
Neighbors
Area 0.0.0.0 interface 192.168.2.2(GigabitEthernet2/0/0)'s neighbors
Router ID: 1.1.1.1 Address: 192.168.2.1
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.2.2 BDR: 192.168.2.1 MTU: 0
Dead timer due in 36 sec
Retrans timer interval: 5
Neighbor is up for 00:15:04
Authentication Sequence: [ 0 ]
# On Router C, run the display gtsm statistics all command. You can view GTSM statistics on RouterC. The default behavior is pass, no illegal packets exist, and the number of discarded packets is 0.
<RouterC> display gtsm statistics all
GTSM Statistics Table
----------------------------------------------------------------
SlotId Protocol Total Counters Drop Counters Pass Counters
----------------------------------------------------------------
0 BGP 0 0 0 0 BGPv6 0 0 0 0 OSPF 0 0 0 0 LDP 0 0 0 1 BGP 0 0 0 1 BGPv6 0 0 0 1 OSPF 0 0 0 1 LDP 0 0 0 2 BGP 0 0 0 2 BGPv6 0 0 0 2 OSPF 0 0 0 2 LDP 0 0 0 3 BGP 0 0 0 3 BGPv6 0 0 0 3 OSPF 0 0 0 3 LDP 0 0 0
----------------------------------------------------------------
Configuration files
Configuration file of RouterA
#
sysname RouterA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 10.1.1.1 255.0.0.0
#
ospf 1
area 0.0.0.0
network 10.0.0.0 0.255.255.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
ospf valid-ttl-hops 1
#
return
Configuration file of RouterB
#
sysname RouterB
#
router id 2.2.2.2
#
interface GigabitEthernet1/0/0
ip address 192.168.1.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 192.168.1.0 0.0.0.255
#
ospf valid-ttl-hops 2
#
return
Configuration file of RouterC
#
sysname RouterC
#
router id 3.3.3.3
#
interface GigabitEthernet2/0/0
ip address 192.168.2.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 192.168.2.0 0.0.0.255
#
ospf valid-ttl-hops 2
#
return
Configuration file of RouterD
#
sysname RouterD
#
router id 4.4.4.4
#
interface GigabitEthernet1/0/0
ip address 10.1.1.2 255.0.0.0
#
ospf 1
area 0.0.0.0
network 10.0.0.0 0.255.255.255
#
return