思科模拟器:[33]实际工程案例第十三讲
1、上一讲,我们添加了相应的VLAN,这一讲我们将通过DHCP功能自动获取IP地址
2、连接两台设备,在实际环境中我们要使用光.纤.终.端.盒,利用光纤来连接,但是本模拟器中没有这个设备,我们就简化为直通线连接
3、将核心的端口类型改为truck类型,代码如下【Switch>enSwit罕铞泱殳ch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface range f0/1-24Switch(config-if-range)#switchport trunk encapsulation dot1qSwitch(config-if-range)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to upSwitch(config-if-range)#】
4、同理,修改交换机0的端口类型为truck,代码如下【Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#intSwitch(config)#interface rSwitch(config)#interface range f0/1-24Switch(config-if-range)#swSwitch(config-if-range)#switchport mSwitch(config-if-range)#switchport mode trSwitch(config-if-range)#switchport mode trunkSwitch(config-if-range)#】
5、将两个端口分别加入VLAN20和VLAN10,代码如下【Switch(config)#intSwitch(config)#interface f0/1Switch(config-if)#swSwitch(config-if)#switchport aSwitch(config-if)#switchport access vSwitch(config-if)#switchport access vlan 20Switch(config-if)#exitSwitch(config)#interface f0/2Switch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#】
6、修改交换机1的端口类型,将所有瞿搋村乇端口加入VLAN40【Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#intSwitch(config)#interface rSwitch(config)#interface range f0/1Switch(config-if-range)#switchport access vlan 40Switch(config-if-range)#exitSwitch(config)#swSwitch(config)#interface range f0/1-24Switch(config-if-range)#swSwitch(config-if-range)#switchport mode trunkSwitch(config-if-range)#】
7、打开终端设备,将ip地址改为自动获取,就可以看见获取到了一个有效的IP地址