赞
踩
目录
H3C版本 HCL_V2.1.0_Setup
VirtualBox版本 VirtualBox-4.2.4-81684-Win
(版本需匹配才可以正常使用H3C)
一共做两个实验。两个基础的H3C静态路由实验。
1.了解静态路由的实验原理
2.掌握静态路由的配置
(1)静态路由定义
要想实现全网通信,也就是网络中的任意两个节点都能通信,这就要求每个路由器的路由表中必须有到所有网段的路由。对于路由器来说,它只知道自己直连的网段,对于没有直连的网段,需要管理员人工添加到这些网段的路由。管理员人工添加到某个网段如何转发,就是静态路由。
(2)静态路由配置
要想实现全网络通信,必须添加路由条目。
AR1路由器直连A、B两个网段,C、D网段没有直连,则需要添加到C、D网段的路由。
ip route-static 到达的目标网络号 子网掩码 下一跳的路由器接口地址
ip route-static 172.16.1.0 24 172.16.0.2
路由器 | 端口 | 端口IP地址 |
R1 | GE_0/1 | 192.168.2.1/24 |
GE_0/0 | 192.168.1.1/24 | |
R2 | GE_0/1 | 192.168.3.1/24 |
GE_0/0 | 192.168.2.2/24 | |
R3 | GE_0/1 | 192.168.4.1/24 |
GE_0/0 | 192.168.3.2/24 | |
SWA | GE_0/1 | 192.168.4.2/24 |
GE_0/2 | 192.168.5.1/24 |
主机名 | IP地址/网络掩码 | 网关 |
PC1 | 192.168.1.88/24 | 192.168.1.1 |
PC2 | 192.168.5.88/24 | 192.168.5.1 |
- <H3C>system-view
- [H3C]interface GigabitEthernet0/0
- [H3C-GigabitEthernet0/0] ip address 192.168.1.1 255.255.255.0
- [H3C-GigabitEthernet0/0] quit
- [H3C]interface GigabitEthernet0/1
- [H3C-GigabitEthernet0/1] ip address 192.168.2.1 255.255.255.0
- [H3C-GigabitEthernet0/1] quit
- [H3C]ip route-static 192.168.3.0 24 192.168.2.2
- [H3C]ip route-static 192.168.4.0 24 192.168.2.2
- [H3C]ip route-static 192.168.5.0 24 192.168.2.2
- <H3C>system-view
- [H3C]interface GigabitEthernet0/0
- [H3C-GigabitEthernet0/0] ip address 192.168.2.2 255.255.255.0
- [H3C-GigabitEthernet0/0] quit
- [H3C]interface GigabitEthernet0/1
- [H3C-GigabitEthernet0/1] ip address 192.168.3.1 255.255.255.0
- [H3C-GigabitEthernet0/1] quit
- [H3C]ip route-static 192.168.1.0 24 192.168.2.1
- [H3C]ip route-static 192.168.4.0 24 192.168.3.2
- [H3C]ip route-static 192.168.5.0 24 192.168.3.2
- <H3C>system-view
- [H3C]interface GigabitEthernet0/0
- [H3C-GigabitEthernet0/0] ip address 192.168.3.2 255.255.255.0
- [H3C-GigabitEthernet0/0] quit
- [H3C]interface GigabitEthernet0/1
- [H3C-GigabitEthernet0/1] ip address 192.168.4.1 255.255.255.0
- [H3C-GigabitEthernet0/1] quit
- [H3C]ip route-static 192.168.1.0 24 192.168.3.1
- [H3C]ip route-static 192.168.2.0 24 192.168.3.1
- [H3C]ip route-static 192.168.5.0 24 192.168.4.2
- [H3C]vlan 10
- [H3C-vlan10]port g1/0/1
- [H3C-vlan10]int vlan 10
- [H3C-Vlan-interface10]ip address 192.168.4.2 24
- [H3C-Vlan-interface10]vlan 20
- [H3C-vlan20]port g1/0/2
- [H3C-Vlan-interface20]ip address 192.168.5.1 24
- [H3C-Vlan-interface20]quit
- [H3C]ip route-static 192.168.1.0 24 192.168.4.1
- [H3C]ip route-static 192.168.2.0 24 192.168.4.1
- [H3C]ip route-static 192.168.3.0 24 192.168.4.1
- [H3C]int g1/0/1
- [H3C-GigabitEthernet1/0/1]port link-type access
- [H3C-GigabitEthernet1/0/1]port access vlan 10
- [H3C-GigabitEthernet1/0/1]int g1/0/2
- [H3C-GigabitEthernet1/0/2]port link-type access
- [H3C-GigabitEthernet1/0/2]port access vlan 20
- (1)显示全部路由:display ip routing-table
- (2)只显示静态路由:display ip route-table protocol static
- (3)删除静态路由:undo ip route-static 172.16.1.0 24 172.16.0.2
两台PC机互相ping通
1.路由器只关心到某个网段如何转发数据包,因此在路由器上添加路由,必须是到某个网段(子网)的路由,不能添加到某个特定地址的路由。添加到一个IP地址的路由,主机位会自动归零。
2.路由器点到点链路的另一种路条目写法
ip route-static 到达的目标网络号 子网掩码 下一跳的路由器接口
ip route-static 172.16.1.0 24 E0/03.trunk口用于同vlan不同交换机间通信。
实现多网段间的互相通信,划分数据包的路径。
设备名称 | 端口 | 端口IP地址/网络掩码 |
MSR36-20_1 | GE 0/0 | 192.168.1.2/24 |
GE 0/1 | 192.168.2.1/24 | |
MSR36-20_2 | GE 0/0 | 192.168.1.1/24 |
MSR36-20_3 | GE 0/1 | 192.168.2.2/24 |
[H3C]int GigabitEthernet 0/0
[H3C-GigabitEthernet0/0]ip address 192.168.1.2 24
[H3C-GigabitEthernet0/0]quit
[H3C]int GigabitEthernet 0/1
[H3C-GigabitEthernet0/1]ip address 192.168.2.1 24
[H3C-GigabitEthernet0/1]quit
[H3C]int GigabitEthernet 0/0
[H3C-GigabitEthernet0/0]ip address 192.168.1.1 24
[H3C-GigabitEthernet0/0]quit
[H3C]ip route-static 192.168.2.0 24 192.168.1.2
[H3C]int GigabitEthernet 0/1
[H3C-GigabitEthernet0/1]ip address 192.168.2.2 24
[H3C-GigabitEthernet0/1]quit
[H3C]ip route-static 192.168.1.0 24 192.168.2.1
这样就可以实现全网的互通了,这些都是基础的实验。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。