Cisco路由器配置三层交换机添加默认路由

Cisco三层交换机添加默认路由

网络工程师配置三层交换机添加默认路由

拓扑及实验要求
实验目标
 掌握综合路由器的配置方法;
 掌握查看通过路由重分布学习产生的路由;
 熟悉广域网线缆的链接方式

实验设备
Router_2811 2台;Switch_3560 1台;直通线;交叉线

S1配置
Switch>en
Switch#conf t
Switch#hostname S1

S1(config)#vlan 2
S1(config-vlan)#exit

S1(config)#vlan 3
S1(config-vlan)#exit

S1(config)#interface fastEthernet 0/2
S1(config-if)#switchport access vlan 2
S1(config-if)#exit

S1(config)#interface fastEthernet 0/3
S1(config-if)#switchport access vlan 3
S1(config-if)#exit

S1(config)#interface vlan 2
S1(config-if)#no shutdown
S1(config-if)#ip address 192.168.1.1 255.255.255.0
S1(config-if)#exit

S1(config)#interface vlan 3
S1(config-if)#no shutdown
S1(config-if)#ip address 192.168.3.1 255.255.255.0
S1(config-if)#exit

S1(config)#ip routing
S1(config)#router rip
S1(config-router)#network 192.168.1.0
S1(config-router)#network 192.168.3.0
S1(config-router)#version 2
S1(config-router)#exit
S1(config)# ip route 0.0.0.0 0.0.0.0 192.168.3.2
S1(config)#end
S1#show ip route
S1#show run
查看S1
S1#show ip route

R1配置
Router>en
Router#conf t
Router(config)#hostname R1

R1(config)#interface fastEthernet 0/0
R1(config-if)#no shutdown
R1(config-if)#ip address 192.168.3.2 255.255.255.0
R1(config-if)#exit

R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address 192.168.4.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#router rip
R1(config-router)#network 192.168.3.0
R1(config-router)#version 2
R1(config-router)#exit

R1(config)#router ospf 1
R1(config-router)#network 192.168.4.0 0.0.0.255 area 0
R1(config-router)#exit

R1(config)#router rip
R1(config-router)#redistribute ospf 1
R1(config-router)#exit

R1(config)#router ospf 1
R1(config-router)#redistribute rip subnets
R1(config-router)#end

R1#show ip route
R1#show run

查看R1
R1#show ip route

R2配置
Router>en
Router#conf t
Router(config)#hostname R2

R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface fastEthernet 0/1
R2(config-if)#no shutdown
R2(config-if)#ip address 192.168.4.2 255.255.255.0
R2(config-if)#exit

R2(config)#router ospf 1
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#network 192.168.4.0 0.0.0.255 area 0
R2(config-router)#end
R2#show ip route
R2#show run

查看R2
R2#show ip route

 

成为第一个发表评论的人

发表评论

您的电子邮件地址不会被公开.


*