1. [问题1]
公司使用VTP协议规划VLAN,三层交换机S1为VTP Sever,其他交换机为VTP Client,并通过S1实现VLAN间通信。请根据网络拓扑和需求说明,完成交换机S1和S2的配置。
S1>enable
S1#configure terminal
S1 (config) #vtp mode ______
S1 (config) #vtp domain shx
S1 (config) #vtp password shx
S1 (config) #vlan 10
S1 (eonfig-vlan) #exit
S1 (config) #vlan 20
S1 (config-vlan) #exit
S1 (config) #interface vlan 10
S1 (config-if) #ip address ______ ______
S1 (config-if) #exit
S1 (config) #interface vlan 20
S1 (config-if) #ip address 192.168.20.254 255.255.255.0
S1 (config-if) #exit
S1 (config) #intetrace ______ fastethernet 0/22-23
S1 (config-if-range) #switchport mode access
S1 (config-if-range) #switchporn mode ______
S1 (config-if-range) #exit
S1 (config) #interface fastEthernet 0/1
S1 (config-if) # ______ //关闭二层功能
S1 (config-if) #ip add 192.168.40.254 255255255.0
S1 (config-if) #exit
……
S1 (config) # ______ ______ //开启路由功能
S1 (config) #
S2>enable
S2#configure terminal
S2 (config) #vtp mode ______
S2 (config) #vtp domain shx
S2 (config) #vtp password shx
S2 (config) #intererce fastethernet 0/24
S2 (config-if) #switchport mode ______ //设定接口模式
S2 (config-if) #end
S2#
server
192.168.10.254
255.255.255.0
range
trunk
no swichport
ip
routing
client
trunk
[解析] 通过VLAN中继协议(VTP)可以减少在多台设备上配置同一VLAN信息的工作量,并保证整个网络VLAN配置的一致性。VTP有3种工作模式:服务模式(VTP Setver)、客户模式(VTP client)和透明模式(VTP Transparent)。通常,一个VTP域内的整个网络只设1个VTP Server。VTP Server维护该VTP域中所有VLAN信息列表,VTP Server可以建立、删除或修改VLAN,发送并转发相关的通告信息,同步vlan配置,并把配置保存在NVRAM中。依题意,在三层交换机S1全局配置模式下,使用命令vtp mode server可将当前交换机的VTP模式设置为VTP Sever。
由题干给出的“VLAN10采用192.168.10.0/24网段,VLAN20采用192.168.20.0/24网段,每段最后一个地址作为网关地址”等关键信息可知,VLAN10的网关地址为192.168.10.254/24,VLAN20的网关地址为192.168.20.254/24。参照VLAN20网关地址的配置语句ip address 192.168.20.254 255.255.255.0,可得VLAN10网关地址的配置语句ip address 192.168.10.254 255.255.255.0
配置命令interface range fastehternet用于绑定一组交换机端口,并进入端口批量配置视图。
虚拟局域网中继(VLAN Trunk)是在同一个域的交换机与交换机(或交换机与路由器)之间的物理链路上能够传输多个VLAN信息的技术。在端口配置模式下,使用命令switchportmode trunk将当前交换端口设置为Trunk模式。根据上图所示的公司网络拓扑结构,三层交换机S1通过端口f0/23、f0/24分别与接入层交换机S2和S3的f0/24端口进行连接。因此,需要将S1的f0/23、f0/24端口设置为Trunk模式,使得这两个端口能够传输VLAN1、VLAN10、VLAN20等信息。
三层交换机是一种带有三层路由功能的交换机,其端口既有三层路由功能,也具有二层交换功能。三层交换机端口默认为二层模式,接口配置模式下使用不带参数的switchport命令,把一个接口设置为二层模式;若需要关闭二层功能、启用三层功能,则需要在此端口输入no switchport命令。
三层交换机默认情况下路由功能是关闭的,需要使用命令ip routing手动开启路由功能。
VTP Client虽然也维护所有VLAN信息列表,但其VLAN的配置信息是从VTP Server学习的。VTP Client不能建立、删除或修改VLAN,但可以转发通告,同步vlan配置,但不把配置保存配置到NVRAM中。依题意,交换机S2的VTP模式设置为VTP Client。
2. [问题2]
公司申请了202.165.200.0/29地址段,使用NAT-PT为用户提供Internet访问,外部全局地址为202.165.200.1,Web服务器使用的外部映射地址为202.165.200.3。请根据网络拓扑和需求说明,完成路由器R1的配置。
R1 (confiG) #interface serial 0/0/0
R1 (config-if) #ip address 202.165.200.1 255.255.255.248
R1 (config-if) #no shutdown
R1 (config-if) #clock rate 4000000
R1 (config-if) #ip address 192.168.50.254 255.255.255.0
R1 (config-if) #no shutdown
R1 (config-if) #exit
R1 (config) #ip nat inside source ______ 1 interface S0/0/0 Overload
R1 (config) #ip nat inside source static ______ 202.165.200.3
R1 (config) #interface fastethernet 0/0
R1 (config-if) #ip nat ______
R1 (config-if) #interface serial 0/0/0
R1 (config-if) #ip nat ______
R1 (config-if) #end
R1#
permit
list
192.168.40.1
inside
outside
[解析] 在路由器全局配置模式下,配置标准ACL的命令是access-list access-list-number {permit | deny} source wildcard-mask。其中,表号access-list-number可以是1~99和1300~1999范围中的任何一个数字;通配符(Wildcard-mask)是子网掩码的反码形式。依题意,定义一条表号为1、允许企业内网中192.168.10.0/24网段(即VLAN10)的主机可以访问Internet的标准ACL配置语句是:access-list 1 permit 192.168.10.0 0.0.0.255。
在路由器全局配置模式下,使用命令ip nat inside source list access-list-number interface interfaceport定义内部源地址动态转换关系。依题意,配置语句ip nat inside source list 1 interface S0/0/0 Overload的功能是,满足表号为1的ACL访问规则的内网用户与S0/0/0所配置的合法地址池进行动态NAT转换。
根据上图所示的网络拓扑信息可知,Web服务器配置的内网IP地址为192.168.40.1/24。结合题干给出的“Web服务器使用的外部映射地址为202.165.200.3”等关键信息,需要使用静态NAT技术来映射这一Web服务器,其相应的配置语句为ip nat inside source static 192.168.40.1 202.165.200.3。
在路由器全局配置模式下,使用命令ip nat outside将当前接口定义为NAT的外部转换接口;使用命令ip nat inside将当前接口定义为NAT的内部转换接口。由上图所示的网络拓扑结构和题干所给出的地址信息可知,路由器的S0/0/0接口应定义为NAT的外部转换接口,f0/0接口应定义为NAT的内部转换接口。