单臂路由小型实验
单臂路由小型实验 利用vlan
操作方法
- 01
打开软件选择两台PC+1台交换机+1台路由器,PC与交换机用直通线连接,交换机与路由器用直通线连接
- 02
配置交换机: Switch>en Switch#config Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#exit Switch# %SYS-5-CONFIG_I: Configured from console by console Switch#vlan da Switch#vlan database % Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode. Switch(vlan)#vlan 2 VLAN 2 added: Name: VLAN0002 Switch(vlan)#vlan 3 VLAN 3 added: Name: VLAN0003 Switch(vlan)#exit APPLY completed. Exiting.... Switch#config Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# interface fastEthernet 0/2 Switch(config-if)#switchport access vlan 2 Switch(config-if)#no shutdown Switch(config-if)#exit Switch(config)#interface fastEthernet 0/3 Switch(config-if)#switchport access vlan 3 Switch(config-if)#no shutdown Switch(config-if)#exit Switch(config)#interface fastEthernet 0/1 Switch(config-if)#switchport mode trunk Switch(config-if)#no shutdown Switch(config-if)#exit
- 03
配置路由器: Router>en Router#config Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface fastEthernet 0/0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#interface fastEthernet 0/0.1 Router(config-subif)#encapsulation dot1Q 2 Router(config-subif)#ip address 192.168.2.1 255.255.255.0 Router(config-subif)#no shutdown Router(config-subif)#exit Router(config)#interface fastEthernet 0/0.2 Router(config-subif)#encapsulation dot1Q 3 Router(config-subif)#ip add 192.168.3.1 255.255.255.0 Router(config-subif)#no shutdown Router(config)#end Router# write Building configuration... [OK]
- 04
分别给两台PC配置IP地址和网关 PC1:192.168.2.10 255.255.255.0 192.168.2.1 PC2:192.168.3.10 255.255.255.0 192.168.3.1