华为HCIA认证考试静态路由配置方法实验案例分析
我畏时光
本文讲述了华为HCIA认证考试静态路由配置方法实验。分享给大家供大家参考,具体如下:
HCIA---静态路由
目录
搭建拓扑图
实验要求
1.内网所有IP基于172.16.0.0/16进行子网划分
2.尽量减少路由条目
3.不能出环
4.R3 - R4之间正常走1000M线路,1000M坏了走100M,备份
5.全网可达
配置过程
划分子网
172.16.0.0 /16
172.16. 000 0 0000.0
255.255. 000 0 0000.0
借三位
172.16.0.0 /20–借一位,作为DHCP下放网段
172.16.0.0 /21-- R2—PC2
172.16.16.0 /21–R2—PC3
172.16.32.0 /20–借一位,作为DHCP下放网段
172.16.32.0 /21–R3-PC4
172.16.48.0 /21–R3-PC5
172.16.192.0 /20–R1-PC1
172.16.224.0 /20–R4-PC6
主干道网络域:
172.16.64.0 /20
172.16.128.0 /20
172.16.96.0 /20
172.16.160.0 /20
配置各个路由器的地址
R1路由器:
system-view
[Huawei]sysname R1
[R1]interface gi 0/0/0
[R1-GigabitEthernet0/0/0]ip address 172.16.64.1 20
[R1-GigabitEthernet0/0/0]interface gi 0/0/1
[R1-GigabitEthernet0/0/1]ip address 172.16.192.1 20
[R1-GigabitEthernet0/0/1]quit
[R1]
R2路由器:
system-view
[Huawei]sysname R2
[R2]interface gi 0/0/0
[R2-GigabitEthernet0/0/0]ip address 172.16.64.2 20
[R2-GigabitEthernet0/0/0]interface gi 0/0/1
[R2-GigabitEthernet0/0/1]ip address 172.16.96.1 20
[R2-GigabitEthernet0/0/1]interface gi 1/0/0
[R2-GigabitEthernet1/0/0]ip address 172.16.0.1 21
[R2-GigabitEthernet1/0/0]interface gi 2/0/0
[R2-GigabitEthernet2/0/0]ip address 172.16.16.1 21
[R2-GigabitEthernet2/0/0]quit
[R2]
R3路由器:
system-view
[Huawei]sysname R3
[R3]interface gi 0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.96.2 20
[R3-GigabitEthernet0/0/0]interface gi 1/0/0
[R3-GigabitEthernet1/0/0]ip address 172.16.32.1 21
[R3-GigabitEthernet1/0/0]interface gi 2/0/0
[R3-GigabitEthernet2/0/0]ip address 172.16.48.1 21
[R3-GigabitEthernet2/0/0]interface gi 0/0/1
[R3-GigabitEthernet0/0/1]ip address 172.16.128.1 20
[R3-GigabitEthernet0/0/1]interface gi 0/0/2
[R3-GigabitEthernet0/0/2]ip address 172.16.160.1 20
[R3]
R4路由器:
system-view
[Huawei]sysname R4
[R4]interface gi 0/0/0
[R4-GigabitEthernet0/0/0]ip address 172.16.128.2 20
[R4-GigabitEthernet0/0/0]interface gi 0/0/1
[R4-GigabitEthernet0/0/1]ip address 172.16.160.2 20
[R4-GigabitEthernet0/0/1]interface gi 1/0/0
[R4-GigabitEthernet1/0/0]ip address 172.16.224.1 20
[R4-GigabitEthernet1/0/0]interface gi 2/0/0
[R4-GigabitEthernet2/0/0]ip address 202.100.1.1 24
[R4]
配置下一跳
R1路由器:
[R1]ip route-static 172.16.0.0 20 172.16.64.2
[R1]ip route-static 172.16.96.0 20 172.16.64.2
[R1]ip route-static 172.16.32.0 20 172.16.64.2
[R1]ip route-static 172.16.128.0 20 172.16.64.2
[R1]ip route-static 172.16.160.0 20 172.16.64.2
[R1]ip route-static 172.16.224.0 20 172.16.64.2
[R1]ip route-static 202.100.1.0 24 172.16.64.2
[R1]ip route-static 0.0.0.0 0.0.0.0 202.100.1.0
save
R2路由器:
[R2]ip route-static 172.16.192.0 20 172.16.64.1
[R2]ip route-static 172.16.32.0 20 172.16.96.2
[R2]ip route-static 172.16.128.0 20 172.16.96.2
[R2]ip route-static 172.16.160.0 20 172.16.96.2
[R2]ip route-static 172.16.224.0 20 172.16.96.2
[R2]ip route-static 202.100.1.0 24 172.16.96.2
[R2]ip route-static 0.0.0.0 0.0.0.0 202.100.1.0
[R2]ip route-static 172.16.0.0 20 null 0 //空接口防环
save
R3路由器:
[R3]ip route-static 172.16.64.0 20 172.16.96.1
[R3]ip route-static 172.16.192.0 20 172.16.96.1
[R3]ip route-static 172.16.0.0 20 172.16.96.1
[R3]ip route-static 172.16.224.0 20 172.16.160.2
[R3]ip route-static 202.100.1.0 24 172.16.160.2
[R3]ip route-static 172.16.224.0 20 172.16.128.2 preference 100 //增大优先值,备份
[R3]ip route-static 202.100.1.0 24 172.16.128.2 preference 100
[R3]ip route-static 0.0.0.0 0.0.0.0 202.100.1.0
[R3]ip route-static 172.16.32.0 20 null 0
save
R4路由器:
[R4]ip route-static 172.16.64.0 20 172.16.160.1
[R4]ip route-static 172.16.192.0 20 172.16.160.1
[R4]ip route-static 172.16.0.0 20 172.16.160.1
[R4]ip route-static 172.16.96.0 20 172.16.160.1
[R4]ip route-static 172.16.32.0 20 172.16.160.1
[R4]ip route-static 172.16.64.0 20 172.16.128.1 preference 100
[R4]ip route-static 172.16.192.0 20 172.16.128.1 preference 100
[R4]ip route-static 172.16.0.0 20 172.16.128.1 preference 100
[R4]ip route-static 172.16.96.0 20 172.16.128.1 preference 100
[R4]ip route-static 172.16.32.0 20 172.16.128.1 preference 100
[R4]ip route-static 0.0.0.0 0.0.0.0 202.100.1.0
save
手动配置PC的 IP地址
此时全网可达。