RIP和OSPF引入
废话少说,上拓扑:
一、实验介绍
本实验是由传统的rip协议逐渐被淘汰有感做的
二、要求
一、VLAN 创建
S3/4:2 ,3 。S1/2: 2,3,5 to 8
1.1、access 端口配置:
S3:连接PC1的接口为access类型,属于VLAN2
S4:连接PC2的接口为access类型,属于VLAN3
1.2、Trunk 端口配置: 下有pvid可一起配置
交换机之间的互连端口全部配置为Trunk类型
Trunk端口允许所有VLAN通过
1.3、PVID 配置:
S1:连接S3的端口的PVID为2、连接S4的端口的PVID为3
S2:连接S3的端口的PVID为2、连接S4的端口的PVID为3
S3:连接交换机S1和S2的端口的PVID为2
S4:连接交换机S1和S2的端口的PVID为3
二、生成树
2.1、所有交换机(S1,S2,S3,S4)均运行MSTP
2.2、MSTP的映射关系如下:
域名为:EXAM
Instance2映射VLAN2
Instance3映射VLAN3
2.3、主备关系如下:
S1:为Instance2的主根桥,为Instance3的备份根桥
S2:为Instance3的主根桥,为Instance2的备份根桥
三:DHCP及DHCP Relay
3.1、根据拓扑图配置路由器接口的IP地址
3.2、在R2上使能DHCP server,在G0/0/0和G0/0/1端口配置从全局地址池分配IP地址
3.3、在R2上配置全局地址池的名字分别为VLAN2,VLAN3,其中参数如下:
VLAN2:网关为192.168.2.1;
地址池为192.168.2.0/24;
不分配的地址为192.168.2.253—192.168.2.254
DNS为:10.1.12.1
VLAN3: 网关为192.168.3.1;
地址池为192.168.3.0/24;
不分配的地址为192.168.3.253—192.168.3.254
DNS为:10.1.22.1
3.4、配置DHCP中继(注:要先在系统视图下启动DHCP)
S1:配置DHCP服务器组名称为dhcp,并将DHCP服务器地址(10.1.12.1)加入组中
S2:配置DHCP服务器组名称为dhcp,并将DHCP服务器地址(10.1.22.1)加入组中
在S1与S2上的vlanif2与vlanif3接口上配置DHCP中继,并使用dhcp组
四:RIP协议
4.1、在R2、S1、S2上配置RIPv2,关闭自动汇总,并通告相应直连网络
4.2、在S1与S2的RIP协议视图下使用import-route引入OSPF路由
五:OSPF配置
5.1、R1上与S1和S2直连的接口,S1和S2上与R1直连的vlanif,全部属于area 0
5.2、在S1与S2的OSPF协议视图下使用import-route引入rip路由
六:VRRP(在S1与S2上实现)
6.1、vlanif地址如下:
S1:vlanif2的IP地址为192.168.2.254/24
S1:vlanif3的IP地址为192.168.3.254/24
S2:vlanif2的IP地址为192.168.2.253/24
S2:vlanif3的IP地址为192.168.3.253/24
6.2、Vlanif2:VRID为2,S1为master,S2为backup,虚拟IP为192.168.2.1/24
Vlanif3:VRID为3,S2为master,S1为backup,虚拟IP为192.168.3.1/24
6.3、Master优先级为120
6.4、抢占延迟为5S
6.5、跟踪上行链路(两条),如果DOWN掉,优先级值减少30
配置完成后,两台PC机要能获取正确的地址,同时能全网互通
三、上配置
黄色标明的代码处要手动去敲,刷配置不知道为啥报错
S3配置
sysname S3
vlan batch 2 to 3
interface Ethernet0/0/1
port link-type access
port default vlan 2
interface Ethernet0/0/2
port link-type trunk
port trunk pvid vlan 2
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/3
port link-type trunk
port trunk pvid vlan 2
port trunk allow-pass vlan 2 to 4094
S4配置
sysname S4
vlan batch 2 to 3
interface Ethernet0/0/1
port link-type access
port default vlan 3
interface Ethernet0/0/2
port link-type trunk
port trunk pvid vlan 3
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/3
port link-type trunk
port trunk pvid vlan 3
port trunk allow-pass vlan 2 to 4094
S1配置
sysname S1
vlan batch 2 to 3 5 7
stp instance 2 root primary
stp instance 3 root secondary
==dhcp enble ==
stp region-configuration
region-name EXAM
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
dhcp server group dhcp
dhcp-server 10.1.12.1 0
interface Vlanif2
ip address 192.168.2.254 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.1
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 5
vrrp vrid 2 track interface Vlanif5 reduced 30
vrrp vrid 2 track interface Vlanif7 reduced 30
dhcp select relay
dhcp relay server-select dhcp
interface Vlanif3
ip address 192.168.3.254 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.1
vrrp vrid 3 track interface Vlanif5 reduced 30
vrrp vrid 3 track interface Vlanif7 reduced 30
interface Vlanif5
ip address 11.1.11.2 255.255.255.0
interface Vlanif7
ip address 10.1.12.2 255.255.255.0
undo rip split-horizon
interface GigabitEthernet0/0/1
port link-type trunk
port trunk pvid vlan 7
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk pvid vlan 3
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/3
port link-type trunk
port trunk pvid vlan 2
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 5
port trunk allow-pass vlan 2 to 4094
ospf 1
import-route rip 1
area 0.0.0.0
network 11.1.11.2 0.0.0.0
rip 1
version 2
network 10.0.0.0
network 192.168.2.0
import-route ospf 1
S2配置
sysname S2
vlan batch 2 to 3 6 8
stp instance 2 root secondary
stp instance 3 root primary
==dhcp enable ==
stp region-configuration
region-name EXAM
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
dhcp server group dhcp
dhcp-server 10.1.22.1 0
interface Vlanif2
ip address 192.168.2.253 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.1
vrrp vrid 2 track interface Vlanif6 reduced 30
vrrp vrid 2 track interface Vlanif8 reduced 30
interface Vlanif3
ip address 192.168.3.253 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.1
vrrp vrid 3 priority 120
vrrp vrid 3 preempt-mode timer delay 5
vrrp vrid 3 track interface Vlanif6 reduced 30
vrrp vrid 3 track interface Vlanif8 reduced 30
dhcp select relay
dhcp relay server-select dhcp
interface Vlanif6
ip address 11.1.12.2 255.255.255.0
interface Vlanif8
ip address 10.1.22.2 255.255.255.0
undo rip split-horizon
interface GigabitEthernet0/0/1
port link-type trunk
port trunk pvid vlan 6
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk pvid vlan 2
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/3
port link-type trunk
port trunk pvid vlan 3
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 8
port trunk allow-pass vlan 2 to 4094
ospf 1
import-route rip 1
area 0.0.0.0
network 11.1.12.2 0.0.0.0
rip 1
version 2
network 10.0.0.0
network 192.168.3.0
import-route ospf 1
R1配置
sysname R1
interface GigabitEthernet0/0/0
ip address 11.1.11.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 11.1.12.1 255.255.255.0
ospf 1
area 0.0.0.0
network 11.1.11.1 0.0.0.0
network 11.1.12.1 0.0.0.0
R2配置
sysname R2
dhcp enable
ip pool VLAN2
gateway-list 192.168.2.1
network 192.168.2.0 mask 255.255.255.0
excluded-ip-address 192.168.2.253 192.168.2.254
dns-list 10.1.12.1
ip pool VLAN3
gateway-list 192.168.3.1
network 192.168.3.0 mask 255.255.255.0
excluded-ip-address 192.168.3.253 192.168.3.254
dns-list 10.1.22.1
interface GigabitEthernet0/0/0
ip address 10.1.22.1 255.255.255.0
undo rip split-horizon
dhcp select global
interface GigabitEthernet0/0/1
ip address 10.1.12.1 255.255.255.0
undo rip split-horizon
dhcp select global
rip 1
version 2
network 10.0.0.0
四、结果验证