- Table of Contents
-
- 06-Layer 3 - IP Services Command Reference
- 00-Preface
- 01-ARP commands
- 02-IP addressing commands
- 03-DNS commands
- 04-IP forwarding basics commands
- 05-Fast forwarding commands
- 06-Adjacency table commands
- 07-IRDP commands
- 08-IP performance optimization commands
- 09-UDP helper commands
- 10-IPv6 basics commands
- 11-IPv6 fast forwarding commands
- 12-Tunneling commands
- 13-GRE commands
- 14-HTTP redirect commands
- Related Documents
-
Title | Size | Download |
---|---|---|
04-IP forwarding basics commands | 48.27 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
Route destination count: 5
Directly-connected host count: 0
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 MGE0/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
Route destination count: 6
Directly-connected host count: 0
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 MGE0/0/0 Null
20.20.20.0/32 20.20.20.25 UBH MGE0/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 MGE0/0/0 Null
20.20.20.255/32 20.20.20.25 UBH MGE0/0/0 Null
# Display the FIB entries matching the destination IP address 10.2.1.1.
<Sysname> display fib 10.2.1.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 |
Route destination count |
Total number of route destination addresses. |
Directly-connected host count |
Number of directly-connected hosts that the device learns through features such as ARP. |
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. |
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 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
bandwidth-based-sharing
Use bandwidth-based-sharing to enable IPv4 load sharing based on bandwidth.
Use undo bandwidth-based-sharing to disable IPv4 load sharing based on bandwidth.
Syntax
bandwidth-based-sharing
undo bandwidth-based-sharing
Default
The IPv4 load sharing based on bandwidth is disabled.
Views
System view
Predefined user roles
network-admin
Usage guidelines
This feature load shares flows only from CSPEX cards (except CSPEX-1204 and CSPEX-1104-E) and CEPC cards.
This feature load shares flow traffic among multiple output interfaces based on their load percentages. The device calculates the load percentage for each output interface in terms of their expected bandwidths.
Devices that run load sharing protocols, such as Locator/ID Separation Protocol (LISP), implement load sharing based on the ratios defined by these protocols.
Examples
# Enable IPv4 load sharing based on bandwidth.
<Sysname> system-view
[Sysname] bandwidth-based-sharing
ip load-sharing mode
Use ip load-sharing mode to configure the load sharing mode.
Use undo ip load-sharing mode to restore the default.
Syntax
In standalone mode:
ip load-sharing mode per-flow [ algorithm algorithm-number | [ dest-ip | dest-port | ip-pro | src-ip | src-port ] * ] { global | slot slot-number }
undo ip load-sharing mode { global | slot slot-number }
In IRF mode:
ip load-sharing mode per-flow [ algorithm algorithm-number | [ dest-ip | dest-port | ip-pro | src-ip | src-port ] * ] { chassis chassis-number slot slot-number | global }
undo ip load-sharing mode { chassis chassis-number slot slot-number | global }
Default
The device performs per-flow load sharing based on destination IP address, source IP address, destination port, and source port.
Views
System view
Predefined user roles
network-admin
Parameters
per-flow: Implements per-flow load sharing.
dest-ip: Identifies flows by destination IP address.
dest-port: Identifies flows by destination port.
ip-pro: Identifies flows by protocol number.
src-ip: Identifies flows by source IP address.
src-port: Identifies flows by source port.
ingress-port: Identifies flows by ingress port.
algorithm algorithm-number: Specifies an algorithm for per-flow load sharing. The value range for the algorithm-number argument is 0 to 9. If you do not specify an algorithm, the default algorithm value is 0. If you specify an algorithm and then execute the undo ip load-sharing mode command, the algorithm value is set to 0.
global: Configures the load sharing mode globally.
slot slot-number: Specifies a card by its slot number. If you do not specify a card, this command configures the load sharing mode for all cards. (In standalone mode.)
chassis chassis-number slot slot-number: Specifies a card on an IRF member device. The chassis-number argument represents the member ID of the IRF member device. The slot-number argument represents the slot number of the card. If you do not specify a card, this command configures the load sharing mode for all cards. (In IRF mode.)
Usage guidelines
The CSPEX cards (except CSPEX-1204 and CSPEX-1104-E) and CEPC cards support only the dest-ip, dest-port, src-ip, and src-port keywords. Those cards do not support the ip-pro keyword or the algorithm keyword.
If this command (equal-cost load sharing mode) and load sharing mode for link aggregation are both configured on CSPEX cards (except CSPEX-1204 and CSPEX-1104-E) and CEPC cards, this command takes effect. For more information about load sharing mode for link aggregation, see Ethernet link aggregation in Layer 2—LAN Switching Configuration Guide.
Examples
# (In standalone mode.) Configure per-flow load sharing for the card in slot 3.
<Sysname> system-view
[Sysname] ip load-sharing mode per-flow slot 3