- Table of Contents
-
- 04-Layer 3-IP Services Command Reference
- 00-Preface
- 01-ARP commands
- 02-IP addressing commands
- 03-DHCP commands
- 04-DNS commands
- 05-mDNS relay commands
- 06-IP forwarding basics commands
- 07-Fast forwarding commands
- 08-IRDP commands
- 09-Adjacency table commands
- 10-IP performance optimization commands
- 11-UDP helper commands
- 12-IPv6 basics commands
- 13-DHCPv6 commands
- 14-IPv6 fast forwarding commands
- 15-GRE commands
- 16-HTTP redirect commands
- 17-Tunneling commands
- Related Documents
-
Title | Size | Download |
---|---|---|
06-IP forwarding basics commands | 84.23 KB |
Basic IP forwarding commands
display fib
Use display fib to display FIB entries.
Syntax
display fib [ vpn-instance vpn-instance-name ] [ ip-address [ mask | mask-length ] ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. To display the FIB entries for the public network, do not specify any VPN.
ip-address: Displays the FIB entry that matches the specified destination IP address.
mask: Specifies the mask for the IP address.
mask-length: Specifies the mask length for the IP address. The value range is 0 to 32.
Usage guidelines
If you specify an IP address without a mask or mask length, this command displays the longest matching FIB entry.
If you specify an IP address and a mask or mask length, this command displays the exactly matching FIB entry.
Examples
# Display all FIB entries of the public network.
<Sysname> display fib
Destination count: 5 FIB entry count: 5
Flag:
U:Usable G:Gateway H:Host B:Blackhole D:Dynamic S:Static
R:Relay F:FRR
Destination/Mask Nexthop Flag OutInterface/Token Label
0.0.0.0/32 127.0.0.1 UH InLoop0 Null
1.1.1.0/24 192.168.126.1 USGF M-GE0/0/0 Null
127.0.0.0/8 127.0.0.1 U InLoop0 Null
127.0.0.0/32 127.0.0.1 UH InLoop0 Null
127.0.0.1/32 127.0.0.1 UH InLoop0 Null
# Display the FIB entries for VPN vpn1.
<Sysname> display fib vpn-instance vpn1
Destination count: 6 FIB entry count: 6
Flag:
U:Usable G:Gateway H:Host B:Blackhole D:Dynamic S:Static
R:Relay F:FRR
Destination/Mask Nexthop Flag OutInterface/Token Label
0.0.0.0/32 127.0.0.1 UH InLoop0 Null
20.20.20.0/24 20.20.20.25 U M-GE0/0/0 Null
20.20.20.0/32 20.20.20.25 UBH M-GE0/0/0 Null
20.20.20.25/32 127.0.0.1 UH InLoop0 Null
20.20.20.25/32 20.20.20.25 H M-GE0/0/0 Null
20.20.20.255/32 20.20.20.25 UBH M-GE0/0/0 Null
# Display the FIB entries matching the destination IP address 10.2.1.1.
<Sysname> display fib 10.2.1.1
Destination count: 1 FIB entry count: 1
Flag:
U:Usable G:Gateway H:Host B:Blackhole D:Dynamic S:Static
R:Relay F:FRR
Destination/Mask Nexthop Flag OutInterface/Token Label
10.2.1.1/32 127.0.0.1 UH InLoop0 Null
Table 1 Command output
Field |
Description |
Destination count |
Total number of destination addresses. |
FIB entry count |
Total number of FIB entries. |
Destination/Mask |
Destination address and the mask length. |
Nexthop |
Next hop address. |
Flag |
Flags of routes: · U—Usable route. · G—Gateway route. · H—Host route. · B—Blackhole route. · D—Dynamic route. · S—Static route. · R—Relay route. · F—Fast reroute. |
OutInterface/Token |
Output interface/LSP index number. |
Label |
Inner label. |
display fib usage
Use display fib usage to display the FIB table usage.
Syntax
display fib usage
Views
Any view
Predefined user roles
network-admin
network-operator
Usage guidelines
You can view the FIB table usage in the most recent hour.
Examples
# Display the FIB table usage.
<Sysname> display fib usage
FIB table upper limit: 65000
Time FIB count Usage
Current 52000 80%
1 min ago 51351 79%
2 min ago 50711 78%
3 min ago 47748 77%
…
59 min ago 13656 21%
60 min ago 13007 20%
Table 2 Command output
Field |
Description |
FIB table upper limit |
Maximum number of entries supported by the FIB table. |
Time |
Time when the FIB table usage was recorded. |
FIB count |
Number of FIB entries. |
Usage |
FIB table usage, which is the ratio of the real-time FIB entry count to the FIB table upper limit. |
ip forwarding-table save
Use ip forwarding-table save to save the IP forwarding entries to a file.
Syntax
ip forwarding-table save filename filename
Views
Any view
Predefined user roles
network-admin
Parameters
filename filename: Specifies the name of a file, a string of 1 to 255 characters. For information about the filename argument, see file system management in Fundamentals Configuration Guide.
Usage guidelines
The command automatically creates the file if you specify a nonexistent file. If the file already exists, this command overwrites the file content.
To automatically save the IP forwarding entries periodically, configure a schedule for the device to automatically run the ip forwarding-table save command. For information about scheduling a task, see Fundamentals Configuration Guide.
Examples
# Save the IP forwarding entries to the fib.txt file.
<Sysname> ip forwarding-table save filename fib.txt
Load sharing commands
ip load-sharing local-first enable
Use ip load-sharing local-first enable to enable local-first load sharing.
Use undo ip load-sharing local-first enable to disable local-first load sharing.
Syntax
ip load-sharing local-first enable
undo ip load-sharing local-first enable
Default
Local-first load sharing is enabled.
Views
System view
Predefined user roles
network-admin
Examples
# Enable local-first load sharing.
<Sysname> system-view
[Sysname] ip load-sharing local-first enable
ip load-sharing mode
Use ip load-sharing mode to specify a shift value for the load sharing algorithm result.
Use undo ip load-sharing mode to restore the default.
Syntax
ip load-sharing mode per-flow algorithm algorithm-number [ shift shift-number ] { global | slot slot-number }
undo ip load-sharing mode per-flow algorithm algorithm-number [ shift shift-number ]{ global | slot slot-number }
The shift value is 0 for the load sharing algorithm result.
Views
System view
Predefined user roles
network-admin
Parameters
per-flow: Implements per-flow load sharing.
algorithm algorithm-number: Specifies an algorithm for per-flow load sharing. The value range for the algorithm-number argument is 0 to 8.
shift shift-number: Specifies the shift value for the hash algorithm result. The value range is 0 to 15, and the default value is 0.
global: Applies the command globally.
slot slot-number: Specifies an IRF member device by its member ID. If you do not specify a member device, the command applies to all member devices.
Usage guidelines
If traffic is not load shared equally, you can use the shift shift-number option to improve the load sharing.
Examples
# Configure the global per-flow load sharing, set the algorithm to 0, and specify the shift value to 1.
<Sysname> system-view
[Sysname] ip load-sharing mode per-flow algorithm 1 shift 1 global