作者:东莞教育在线 来源:dgedu.com.cn 更新日期:2008-8-31
阅读次数:
rface Vlan12
ip address 192.168.2.1 255.255.255.0
!
interface Vlan100
ip address 10.1.1.1 255.255.255.0
!
interface Vlan101
ip address 10.1.2.1 255.255.255.0
!
interface Vlan105
ip address 172.16.1.1 255.255.255.0
!
ip classless
ip http server
!
line con 0
line vty 5 15
!
end
Layer3SW#
配置静态路由协议
因为核心交换机知道所有内部的网段,只有当核心交换机收到需要访问外部网络的请求时才需要将这些包发送到路由器上。因此只需要在核心交换机上配置一条静态路由即可。
Layer3SW#config t
Enter configuration commands, one per line. End with CNTL/Z.
Layer3SW(config)#ip routing
Layer3SW(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.2
Layer3SW(config)#
这条静态路由称为Default Route, 翻译成中文叫缺省路由。
看一下核心交换机上的路由:
Layer3SW#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 172.16.1.2 to network 0.0.0.0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Vlan105
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Vlan101
C 10.1.1.0 is directly connected, Vlan100
C 192.168.1.0/24 is directly connected, Vlan11
C 192.168.2.0/24 is directly connected, Vlan12
S* 0.0.0.0/0 [1/0] via 172.16.1.2
Layer3SW#
保存配置
Layer3SW#write memory
第九课 路由器的认识,端口的配置演示
图9.1
图9.1是Cisco2600XM系列路由器,由图中可知,该路由器在机箱上配置了2个10/100M快速以太网端口,两个广域网插槽,还有一个网络模块插槽。为了对路由器进行配置,机箱上还有Console口,远程通过Modem连接的AUX接口,通过AUX可以远程通过电话拨号对该路由器进行配置。AUX口还可以通过拨号Modem与远程的路由器连接,起到链路备份的作用。
如果你的校园网需要和Internet或上级的网络连接在一起,一般说来,就需要路由器。最容易理解的连接是:路由器上的一个以太网接口和你的园区网上的核心交换机连接在一起,另一个以太网接口和Internet或上级的网络连接。请参考图9.2。
图9.2
现在就对路由器的相应端口进行配置。
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface f0/0
Router(config-if)#ip address 172.16.1.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#in f0/1
Router(config-if)#ip address 198.100.100.100 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
配置静态路由协议
Router(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1
Router(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.1
Router(config)#ip route 192.168.3.0 255.255.255.0 172.16.1.1
Router(config)#ip route 10.1.1.0 255.255.255.0 172.16.1.1
Router(config)#ip route 10.1.2.0 255.255.255.0 172.16.1.1
Router(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 0/1
Router(config)#
显示配置
Router#sh run
Building configuration...
Current configuration : 911 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
service internal
!
hostname Router
!
!
memory-size iomem 15
ip subnet-zero
!
!
!
!
controller E1 0/0
!
controller E1 0/1
!
!
!
interface FastEthernet0/0
ip address 172.16.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 198.100.100.100 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1
ip route 10.1.1.0 255.255.255.0 172.16.1.1
ip route 10.1.2.0 255.255.255.0 172.16.1.1
ip route 192.168.1.0 255.255.255.0 172.16.1.1
ip route 192.168.2.0 255.255.255.0 172.16.1.1
ip route 192.168.3.0 255.255.255.0 172.16.1.1
ip http server
ip pim bidir-enable
!
simulator sigtran state-check
!
line con 0
line aux 0
line vty 0 4
!
no scheduler allocate
!
end
Router#
显示路由
Router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0/0
10.0.0.0/24 is subnetted, 2 subnets
S 10.1.2.0 [1/0] via 172.16.1.1
S 10.1.1.0 [1/0] via 172.16.1.1
S 192.168.1.0/24 [1/0] via 172.16.1.1
S 192.168.2.0/24 [1/0] via 172.16.1.1
S 192.168.3.0/24 [1/0] via 172.16.1.1
S* 0.0.0.0/0 [1/0] via FastEthernet0/1
保存配置
Router#write memory
15道题,在0.5小时内完成,自愿参加。
前2名成绩者将获得奖励。
如果多人并列前2名,将通过抽签决定。
|