Beruflich Dokumente
Kultur Dokumente
V100R006C00
Issue 01
Date 2011-07-15
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the
customer. All or part of the products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,
and recommendations in this document are provided "AS IS" without warranties, guarantees or representations
of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute the warranty of any kind, express or implied.
Website: http://www.huawei.com
Email: support@huawei.com
Intended Audience
This document provides the basic concepts, configuration procedures, and configuration
examples in different application scenarios of the S2700, including static routes.
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Command Conventions
The command conventions that may be found in this document are defined as follows.
Convention Description
&<1-n> The parameter before the & sign can be repeated 1 to n times.
Change History
Updates between document issues are cumulative. Therefore, the latest document issue contains
all changes made in previous issues.
Contents
Static routes are applicable to simple networks. Properly configuring and using static routes
improve the network performance and help ensure bandwidth for important services.
1.1 Static Route
Static routes are a special type of routes that need to be manually configured.
1.2 Static Routing Features Supported by the S2700
The system supports various static routes, including IPv4 static routes, IPv6 static routes, default
routes.
1.3 Configuring an IPv4 Static Route
On an IPv4 network, you can accurately control route selection by configuring IPv4 static routes.
1.4 Configuring an IPv6 Static Route
On an IPv6 network, you can accurately control route selection by configuring IPv6 static routes.
1.5 Configuration Examples
This section provides configuration examples of static routes.
NOTE
The main differences between IPv6 static routes and IPv4 static routes are their destination addresses and
next-hop addresses. The next-hop address of an IPv6 static route is an IPv6 address, whereas the next-hop
address of an IPv4 static route is an IPv4 address.
Default Route
Default routes are a special type of routes. Generally, administrators can manually configure
default routes.
Default routes are used only when packets to be forwarded fail to match any entry in the routing
table. In the routing table, the destination address and subnet mask of a default route are both
0.0.0.0. You can run the display ip routing-table command to check whether the default route
is configured.
If the destination address of a packet does not match any entry in the routing table, the switch
uses the default route to forward this packet. If no default route exists and the destination address
of the packet does not match any entry in the routing table, the packet is discarded. An Internet
Control Message Protocol (ICMP) packet is then sent back to the originating host, informing
that the destination host or network is unreachable.
Applicable Environment
When configuring an IPv4 static route, note the following:
Pre-configuration Tasks
Before configuring an IPv4 static route, complete the following task:
l Configuring link layer protocol parameters and IP addresses for interfaces to ensure that
the link layer protocol status of the interfaces is Up
Data Preparation
To configure an IPv4 static route, you need the following data.
No. Data
Context
Do as follows on the switch to be configured with static route:
Procedure
Step 1 Run:
system-view
Step 2 Run:
ip route-static ip-address { mask | mask-length } { nexthop-address | interface-
type interface-number [ nexthop-address ] } [ preference preference | tag tag ] *
[ description text ]
----End
Context
Do as follows on the switchs that need to be configured with static routes and change the default
priority for static routes:
Procedure
Step 1 Run:
system-view
----End
Prerequisite
The configurations of an IPv4 static route are complete.
Procedure
l Run the display ip routing-table command to check brief information about the IPv4
routing table.
l Run the display ip routing-table verbose command to check detailed information about
the IPv4 routing table.
----End
Applicable Environment
On a small IPv6 network, you can implement network interconnection by configuring IPv6 static
routes. Compared with using dynamic routes, using static routes saves the bandwidth.
Pre-configuration Tasks
Before configuring an IPv6 static route, complete the following task:
l Configuring link layer protocol parameters and IP addresses for interfaces to ensure that
the link layer protocol status of the interfaces is Up
Data Preparation
To configure an IPv6 static route, you need the following data.
No. Data
Context
Do as follows on the switch to be configured with static routes:
Procedure
Step 1 Run:
system-view
Step 2 Run:
ipv6 route-static dest-ipv6-address prefix-length { interface-type interface-
number nexthop-ipv6-address| nexthop-ipv6-address } [ preference preference | tag
tag ] * [ description text ]
When configuring a static route, you need to specify either the outbound interface or the next-
hop address according to the actual situation. If the outbound interface is a non-P2P interface,
you must also specify the next-hop address in addition to specifying the outbound interface.
----End
Context
Do as follows on the switch that need to be configured with IPv6 static routes and change the
default priority for IPv6 static routes:
Procedure
Step 1 Run:
system-view
----End
Prerequisite
The configurations of an IPv6 static route are complete.
Procedure
l Run the display ipv6 routing-table command to check brief information about the IPv6
routing table.
l Run the display ipv6 routing-table verbose command to check detailed information about
the IPv6 routing table.
----End
Networking Requirements
The PCs that belong to different network segments are connected through several switches. IPv4
static routes should be used so that any two PCs in different network segments can communicate
with each other.
PC2
1.1.2.2/24
Eth0/0/3
Eth0/0/1 Eth0/0/2
Switch B
Switch A Switch C
Eth0/0/1 Eth0/0/1
Eth0/0/2 Eth0/0/2
PC1 PC3
1.1.1.2/24 1.1.3.2/24
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
l The IDs of the VLANs to which the interfaces belong are shown in Figure 1-1.
l The VLANIF interfaces and the IP addresses of the hosts are shown in Figure 1-1.
l The next hop address of the default route on Switch A is 1.1.4.2.
l The destination address of Switch B is 1.1.1.0, and the next hop address of the static route
is 1.1.4.1.
l The destination address of Switch B is 1.1.3.0, and the next hop address of the static route
is 1.1.4.6.
l The next hop address of the default route on Switch C is 1.1.4.5.
Configuration Procedure
1. Create a VLAN to which each interface belongs.
The configuration details are not mentioned here.
2. Assign an IP address to each interface.
The configuration details are not mentioned here.
3. Configure the hosts.
Configure default gateways of the hosts PC1, PC2, and PC3 as 1.1.1.1, 1.1.2.1, and 1.1.3.1
respectively.
4. Configure static routes.
# Configure a default route on Switch A.
<SwitchA> system-view
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
Configuration Files
l Configuration file of Switch A
#
sysname SwitchA
#
vlan batch 10 30
#
interface Vlanif10
ip address 1.1.4.1 255.255.255.252
#
interface Vlanif30
ip address 1.1.1.1 255.255.255.0
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface Ethernet0/0/2
port hybrid pvid vlan 30
port hybrid untagged vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
#
return
vlan batch 20 50
#
interface Vlanif20
ip address 1.1.4.6 255.255.255.252
#
interface Vlanif40
ip address 1.1.3.1 255.255.255.0
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface Ethernet0/0/2
port hybrid pvid vlan 50
port hybrid untagged vlan 50
#
ip route-static 0.0.0.0 0.0.0.0 1.1.4.5
#
return
Networking Requirements
As shown in Figure 1-2, the mask length of all the IPv6 addresses is 64 bits. It is required that
every two hosts or Switches be interconnected through IPv6 static routes.
PC2
2::2/64
Vlanif100
2::1/64
Vlanif1 Vlanif2
4::1/64 5::1/64
Switch B
Switch A Switch C
Vlanif1 Vlanif2
4::2/64 5::2/64
Vlanif100
1::1/64 Vlanif100
3::1/64
PC1 PC3
1::2/64 3::2/64
Configuration Roadmap
The configuration roadmap is as follows:
2. Configure the IPv6 static route and the default route to the destination address on each
Switch.
3. Configure the IPv6 default gateway on each host to make any two hosts reachable.
Data Preparation
To complete the configuration, you need the following data:
l Default gateways of host PC1, host PC2, and host PC3: 1::1, 2::1, and 3::1
Configuration Procedure
1. Assign an IPv6 address to each interface. The configuration details are not mentioned here.
2. Configure IPv6 static routes.
# Configure the IPv6 default route on Switch-A.
[Switch-A] ipv6 route-static :: 0 4::1
Configuration Files
l Configuration file of Switch-A
#
sysname Switch-A
#
ipv6
#
interface Vlanif1
ipv6 address 4::2/64
#
interface Vlanif100
ipv6 address 1::1/64
#
#
ipv6 route-static :: 0 4::1
#
return
return