IPV4 Static Routing configuration Example
Networking requirements
As shown in 1, the hosts belonging to different network segments are connected by several Switch, which requires that the dynamic routing protocol not be configured, so that any two hosts in different network segments can be interconnected.
650) this.width=650; "Src=" Http://localhost:7890/pages/31187420/04/31187420/04/resources/dc/images/fig_dc_cfg_ Static-route_002701.png "alt=" Fig_dc_cfg_static-route_002701.png "/>
Figure 1 Configuring the IP static routing group Network Diagram
Configuration ideas
Use the following ideas to configure IPv4 static Routes:
Create VLAN and configure the VLAN of each interface, configure the IP address of each vlanif interface , realize the network interworking of neighboring devices.
Configure on each host IP Default gateway, Configure IPv4 static route or static default route on each Switch, realize not configure dynamic routing protocol, so that can be interoperable between any two hosts in different network segments.
Operation Steps
1. Configure each interface to belong to Vlan
# Configure SwitchA. The configuration of SwitchB and SWITCHC is similar to SwitchA.
<HUAWEI> System-view
[HUAWEI] sysname SwitchA
[SwitchA] VLAN Batch 10 30
[SwitchA] Interface gigabitethernet 1/0/1
[SWITCHA-GIGABITETHERNET1/0/1] Portlink-type Trunk
[SWITCHA-GIGABITETHERNET1/0/1] Port Trunkallow-pass VLAN 10
[SWITCHA-GIGABITETHERNET1/0/1] Quit
[SwitchA] Interface gigabitethernet 1/0/2
[SWITCHA-GIGABITETHERNET1/0/2] Portlink-type access
[SWITCHA-GIGABITETHERNET1/0/2] Port Defaultvlan 30
[SWITCHA-GIGABITETHERNET1/0/2] Quit
2. Configure each IP Address of the Vlanif interface
# Configure SwitchA. The configuration of SwitchB and SWITCHC is similar to SwitchA.
[SwitchA] Interface vlanif 10
[SWITCHA-VLANIF10] IP address 10.1.4.1 30
[SWITCHA-VLANIF10] Quit
[SwitchA] Interface vlanif 30
[SWITCHA-VLANIF30] IP address 10.1.1.1 24
[SWITCHA-VLANIF30] Quit
3. Configuring the Host
Configuring Hosts the default gateway for PC1 is 10.1.1.1, the default gateway forhost PC2 is 10.1.2.1, and the default gateway for host PC3 is 10.1.3.1.
Configure static Routes
# Configure IP default routes in SwitchA.
[SwitchA] IP route-static 0.0.0.0 0.0.0.010.1.4.2
# Configure two IP static routes in SwitchB.
[SwitchB] IP route-static 10.1.1.0255.255.255.0 10.1.4.1
[SwitchB] IP route-static 10.1.3.0255.255.255.0 10.1.4.6
# Configure IP default routes in SWITCHC.
[SWITCHC] IP route-static 0.0.0.0 0.0.0.010.1.4.5
4. Verify the configuration results
# View The IP routing table for the SwitchA .
[SwitchA] Display IP routing-table
Route flags:r-Relay, D-download to FIB
------------------------------------------------------------------------------
Routing Tables:public
Destinations:7 routes:7
Destination/mask Proto Pre cost Flags nexthop Interface
0.0.0.0/0 Static 0 RD 10.1.4.2 VLANIF10
10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif30
10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
10.1.4.0/30 Direct 0 0 D 10.1.4.1 Vlanif10
10.1.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
# Use the ping command to verify connectivity.
[SwitchA] Ping 10.1.3.1
PING 10.1.3.1:56 data bytes,press Ctrl_c to break
Reply from 10.1.3.1:bytes=56 sequence=1 ttl=253 time=62 ms
Reply from 10.1.3.1:bytes=56 sequence=2 ttl=253 time=63 ms
Reply from 10.1.3.1:bytes=56 sequence=3 ttl=253 time=63 ms
Reply from 10.1.3.1:bytes=56 sequence=4 ttl=253 time=62 ms
Reply from 10.1.3.1:bytes=56 sequence=5 ttl=253 time=62 ms
---10.1.3.1 ping statistics---
5packet (s) transmitted
5packet (s) received
0.00% Packet Loss
Round-trip Min/avg/max = 62/62/63 ms
# Use the Tracert command to verify connectivity.
[SwitchA] tracert 10.1.3.1
Traceroute to 10.1.3.1 (10.1.3.1), Max hops:30, packet length:40,press Ctrl_c tobreak
110.1.4.2 MS-MS
210.1.3.1, MS, MS, MS
5. Configuration Files
configuration file for SwitchA
#
sysname SwitchA
#
VLAN Batch 10 30
#
Interface VLANIF10
IPAddress 10.1.4.1 255.255.255.252
#
Interface VLANIF30
IPAddress 10.1.1.1 255.255.255.0
#
Interface GIGABITETHERNET1/0/1
Portlink-type Trunk
Porttrunk Allow-pass VLAN 10
#
Interface GIGABITETHERNET1/0/2
Portlink-type Access
Portdefault VLAN 30
#
IP route-static 0.0.0.0 0.0.0.0 10.1.4.2
#
Return
configuration file for SwitchB
#
sysname SwitchB
#
VLAN Batch 10 20 40
#
Interface VLANIF10
IPAddress 10.1.4.2 255.255.255.252
#
Interface Vlanif20
IPAddress 10.1.4.5 255.255.255.252
#
Interface Vlanif40
IPAddress 10.1.2.1 255.255.255.0
#
Interface GIGABITETHERNET1/0/1
Portlink-type Trunk
Porttrunk Allow-pass VLAN 10
#
Interface GIGABITETHERNET1/0/2
Portlink-type Trunk
Porttrunk Allow-pass VLAN 20
#
Interface GIGABITETHERNET1/0/3
Portlink-type Access
Portdefault VLAN 40
#
IP route-static 10.1.1.0 255.255.255.010.1.4.1
IP route-static 10.1.3.0 255.255.255.010.1.4.6
#
Return
configuration file for SWITCHC
#
sysname SWITCHC
#
VLAN Batch 20 50
#
Interface Vlanif20
IPAddress 10.1.4.6 255.255.255.252
#
Interface Vlanif50
IPAddress 10.1.3.1 255.255.255.0
#
Interface GIGABITETHERNET1/0/1
Portlink-type Trunk
Porttrunk Allow-pass VLAN 20
#
Interface GIGABITETHERNET1/0/2
Portlink-type Access
Portdefault VLAN 50
#
IP route-static 0.0.0.0 0.0.0.0 10.1.4.5
#
Return
More about static routing knowledge
Static route theory Knowledge: http://www.023wg.com/lypz/89.html
Static routing configuration detailed tutorial: http://www.023wg.com/lypz/90.html
This article is from "Chongqing Network Workers" blog, please be sure to keep this source http://023wg.blog.51cto.com/1462514/1735417
Huawei IPv4 Static Routing configuration Example