The auto detect function uses ICMP
request/reply packets to test the connectivity of a network regularly.
The auto detect function is carried out
through detecting groups. A detecting group comprises of a group of the IP
addresses to be detected. As the states of detecting groups indicate network
state, they can be used to locate network problems in time and trigger network
devices to take proper measures against network problems.
Table 1-1 Configure
the auto detect function
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Create a detecting group and enter detecting
group view
|
detect-group group-number
|
Required
|
|
Add an IP address to be detected to
the detecting group
|
detect-list list-number ip address ip-address [ nexthop
ip-address ]
|
Required
|
|
Specify how the detecting result is
generated
|
option
[ and | or ]
|
Optional
By default, the and keyword is
specified.
|
|
Set the detecting interval
|
timer loop
seconds
|
Optional
By default, the detecting interval is
15 seconds.
|
|
Set the maximum number of retries
during a detecting operation
|
retry retry-times
|
Optional
By default, the maximum number of
retries is 2.
|
|
Set the detecting timeout time
|
timer wait seconds
|
Optional
By default, the
detecting timeout time is 2 seconds.
|
After the above-mentioned configuration,
you can use the display command in any view to view the auto detect
configuration, so as to verify configuration result.
Table 1-2 Display auto detect
configuration
|
Operation
|
Command
|
Description
|
|
Display the configuration of a
detecting group
|
display detect-group [ group-number ]
|
The display command can be
executed in any view.
|
I. Network requirements
l
Create detecting group 10 on Switch A and add
two IP addresses, 10.1.1.4 and 192.168.2.2, to it to test the reachability to
the two IP addresses.
l
Specify to return reachable as the
detecting result if one of the two IP addresses is reachable, that is, specify
the or keyword for the option command.
l
Set the detecting interval to 60 seconds; the
maximum number of retries to 3, and the timeout time to 3 seconds.
II. Network diagram

Figure 1-1 Network diagram for auto detect configuration
III. Configuration procedure
# Enter system view.
<H3C> system-view
# Create detecting group 10.
[H3C] detect-group 10
# Specify to detect the IP address of
10.1.1.4, taking the IP address of 192.168.1.2 as the next hop and setting the
detecting number to 1.
[H3C-detect-group-10] detect-list 1 ip
address 10.1.1.4 nexthop 192.168.1.2
# Specify to detect the IP address of
192.168.2.2, setting the detecting number to 2.
[H3C-detect-group-10] detect-list 2
ip address 192.168.2.2
# Specify to return reachable as the
detecting result if one of the two IP addresses is reachable.
[H3C-detect-group-10] option or
# Set the detecting interval to 60 seconds.
[H3C-detect-group-10] timer loop 60
# Set the maximum number of retries during
a detecting operation to 3.
[H3C-detect-group-10] retry 3
# The IP addresses in the detecting group
are detected after 3 seconds the last detecting operation is performed.
[H3C-detect-group-10] timer wait 3
[H3C-detect-group-10] quit
[H3C]
The results of auto detect operations
(reachable or unreachable) can be used to trigger other functions, such as:
l
Static routing
l
Virtual router redundancy protocol (VRRP)
l
Interface backup
l
Packet redirection
You can utilize a single detecting group simultaneously
in multiple implementations mentioned above.
l
Refer to the Routing Protocol chapter of this
manual for information about static routing.
l
Refer to the VRRP chapter of this manual for
information about VRRP.
By binding a detecting group to a static
route, you can control the validity of a static route according to auto detect
results as follows:
l
Enable the static route when the result of the
detecting group is reachable.
l
Disable the static route when the result of the
detecting group is unreachable.
You need to create the
detecting group before performing the following operations.
Table 2-1 Configure
the auto detect function for a static route
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Bind a
detecting group to a static route
|
ip
route-static ip-address { mask |
mask-length } { interface-type interface-number | next-hop
} [ preference preference-value ] [ reject | blackhole
] detect-group group-number
|
Required
|
I. Network requirements
l
Create detecting group 8 on Switch A. to detect
the reachability of the IP address 10.1.1.4/24, with 192.168.1.2/24 as the next
hop, and the detecting number set to 1.
l
Configure a static route between Switch A and
Switch B.
l
Enable the static route when the result of
detecting group 8 is reachable.
II. Network diagram

Figure 2-1 Network diagram for implementing the auto detect function in static
routing
III. Configuration procedure
l
Configure Switch A.
# Enter system view.
<H3C> system-view
# Create detecting group 8.
[H3C] detect-group 8
# Detect the reachability of 10.1.1.4/24,
with 192.168.1.2/24 as the next hop, and the detecting number set to 1.
[H3C-detect-group-8] detect-list 1 ip
address 10.1.1.4 nexthop 192.168.1.2
[H3C-detect-group-8] quit
# Enable the static route when the
detecting group is reachable. Disable the static route when the detecting group
is unreachable.
[H3C] ip route-static 10.1.1.4 24
192.168.1.2 detect-group 8
You can control the priorities of VRRP
backup groups according to auto detect results to enable automatic switch
between the master and the backup switch as follows:
l
Decrease the priority of a VRRP backup group
when the result of the detecting group is unreachable.
l
Resume the priority of a VRRP backup group when
the result of the detecting group is reachable.
Table 2-2 Configure
the auto detect function for VRRP
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Enter VLAN interface view
|
interface vlan-interface vlan-id
|
—
|
|
Enable the auto detect function for
VRRP
|
Vrrp vrid virtual-router-id track
detect-group group-number [ reduced value-reduced ]
|
Required
|
I. Network requirements
l
Switch B and switch D form VRRP backup group 1,
whose virtual IP address is 192.168.1.10.
l
Packets sourced from Switch A and destined for
Switch C is forwarded by Switch B under normal situations.
l
When the connection between Switch B and Switch C
fails, Switch D becomes the Master in backup group 1 automatically and the link
from Switch D to Switch C, the secondary link, is enabled.
II. Network diagram

Figure 2-2 Network diagram for implementing the auto detect function in VRRP
III. Configuration procedure
l
Configure Switch B.
# Create detecting group 9.
<H3C> system-view
[H3C] detect-group 9
# Specify to detect the reachability of the
IP address 10.1.1.4/24, setting the detect number to 1.
[H3C-detect-group-9] detect-list 1 ip
address 10.1.1.4
[H3C-detect-group-9] quit
# Assign an IP address to VLAN 1 interface.
[H3C] interface vlan-interface 1
[H3C-Vlan-interface1] ip address
192.168.1.2 24
[H3C-Vlan-interface1] quit
# Enable VRRP on VLAN 1 interface and assign
a virtual IP address to the backup group.
[H3C-Vlan-interface1] vrrp vrid 1
virtual-ip 192.168.1.10
# Set the backup group priority of switch B
to 110, and specify to decrease the priority by 20 when the result of detecting
group 9 is unreachable.
[H3C-Vlan-interface1] vrrp vrid 1
priority 110
[H3C-Vlan-interface1] vrrp vrid 1
track detect-group 9 reduced 20
l
Configure Switch D.
# Assign an IP address to VLAN 1 interface.
<H3C> system-view
[H3C] interface vlan-interface 1
[H3C-Vlan-interface1] ip address
192.168.1.3 24
# Enable VRRP on VLAN 1 interface and assign
a virtual IP address to the backup group.
[H3C-Vlan-interface1] vrrp vrid 1
virtual-ip 192.168.1.10
# Set the backup group priority of Switch D
to 100.
[H3C-Vlan-interface1] vrrp vrid 1
priority 100
The interface backup function is used to
back up VLAN interfaces by using the auto detect function. For two VLAN
interfaces configured with the same destination device, you can configure them
to be the primary interface and the secondary interface. The latter is enabled
automatically when the primary fails, so as to ensure the connectivity. In this
case, the auto detect function is implemented as follows:
l
In normal situations (that is, when the result
of the detecting group is reachable), the secondary VLAN interface is
down and packets are transmitted through the primary VLAN interface.
l
When the link between the primary VLAN interface
and the destination operates improperly (that is, the result of the detecting
group is unreachable), the system shuts down the primary VLAN interface
and enables the secondary VLAN interface.
l
When the link between the primary VLAN interface
and the destination recovers (that is, the result of the detecting group
becomes reachable again), the system enables the primary VLAN interface
and shuts down the secondary VLAN interface again.
You need to create the
detecting group and perform configurations concerning VLAN interfaces before the
following operations.
Table 2-3 Configure the auto detect function
for VLAN interface backup
|
Operation
|
Command
|
Description
|
|
Enter
system view
|
system-view
|
—
|
|
Enter VLAN interface view
|
interface vlan-interface vlan_id
|
—
|
|
Enable the auto detect function to
implement VLAN interface backup
|
standby detect-group group-number
|
Required
This operation is only needed on the
secondary VLAN interface.
|
I. Network requirements
l
Configure a static route between Switch C and
Switch A.
l
Create detecting group 10 on Switch A to detect
the connectivity between Switch B and Switch C.
l
Configure VLAN 1 interface to be the primary
interface, which is enabled when the result of detecting group 10 is reachable.
l
Configure VLAN 2 interface to be the secondary
interface, which is enabled when the result of the detecting group 10 is unreachable.
l
Make sure the routes between Switch A, Switch B,
and Switch C are reachable; and those between Switch A, Switch D, and Switch C
are also reachable.
II. Network diagram

Figure 2-3 Network diagram for VLAN interface backup
III. Configuration procedure
l
Configure Switch C.
# Enter system view.
<H3C> system-view
# Configure a static route to VLAN
interface 1 on Switch A as the primary route, with the IP address of 10.1.1.3/24
as the next hop.
[H3C] ip route-static 192.168.1.1 24
10.1.1.3
# Configure a static route to VLAN
interface 2 on Switch A as the secondary route, with the IP address of 20.1.1.3/24
as the next hop.
[H3C] ip route-static 192.168.2.1 24
20.1.1.3
l
Configure Switch A.
# Enter system view.
<H3C> system-view
# Assign an IP address to VLAN 1 interface.
[H3C] interface vlan-interface 1
[H3C-Vlan-interface1] ip address
192.168.1.1 24
[H3C-Vlan-interface1] quit
# Add port GigabitEthernet1/0/2 to VLAN 2.
[H3C] vlan 2
[H3C-vlan2] port GigabitEthernet1/0/2
[H3C-vlan2] quit
# Assign an IP address to VLAN 2 interface.
[H3C] interface vlan-interface 2
[H3C-Vlan-interface2] ip address
192.168.2.1 24
[H3C-Vlan-interface2] quit
# Create auto detecting group 10.
[H3C] detect-group 10
# Add the IP address of 10.1.1.4 to detecting
group 10 to detect the reachability of the IP address, with the IP address of
192.168.1.2/24 as the next hop, and the detecting number set to 1.
[H3C-detect-group-10] detect-list 1
ip address 10.1.1.4 nexthop 192.168.1.2
[H3C-detect-group-10] quit
# Specify to enable VLAN 2 interface when
the result of detecting group 10 is unreachable.
[H3C] interface vlan-interface 2
[H3C-Vlan-interface2] standby
detect-group 10