《17[1].路由器以太网端口单臂路由配置.doc》由会员分享,可在线阅读,更多相关《17[1].路由器以太网端口单臂路由配置.doc(8页珍藏版)》请在金锄头文库上搜索。
1、将交换机和路由器连接起来如下图:PC0-SW0-fa0/1 (192.168.10.10/24)PC0-SW0-fa0/11 (192.168.20.10/24)SW0(Gi1/1)-RO0(Fa0/0)我们首先来配置交换机:SwitchSwitchenSwitchenable Switch#configConfiguring from terminal, memory, or network terminal? Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#inRASwitch(confi
2、g)#in raSwitch(config)#in range faSwitch(config)#in range fastEthernet 0/1-10Switch(config-if-range)#swSwitch(config-if-range)#switchport ? access Set access mode characteristics of the interface mode Set trunking mode of the interface native Set trunking native characteristics when interface is in
3、trunking mode nonegotiate Device will not engage in negotiation protocol on this interface port-security Security related command trunk Set trunking characteristics of the interface voice Voice appliance attributesSwitch(config-if-range)#switchport acSwitch(config-if-range)#switchport access ? vlan
4、Set VLAN when interface is in access modeSwitch(config-if-range)#switchport access vlSwitch(config-if-range)#switchport access vlan 10% Access VLAN does not exist. Creating vlan 10Switch(config-if-range)#in range fastEthernet 0/11-20Switch(config-if-range)#switchport access vlan 20% Access VLAN does
5、 not exist. Creating vlan 20Switch(config-if-range)#Z%SYS-5-CONFIG_I: Configured from console by consoleSwitch(config)#inSwitch(config)#interface giSwitch(config)#interface gigabitEthernet 1/1Switch(config-if)#swSwitch(config-if)#switchport ? access Set access mode characteristics of the interface m
6、ode Set trunking mode of the interface native Set trunking native characteristics when interface is in trunking mode nonegotiate Device will not engage in negotiation protocol on this interface port-security Security related command trunk Set trunking characteristics of the interface voice Voice app
7、liance attributesSwitch(config-if)#switchport acSwitch(config-if)#switchport access ? vlan Set VLAN when interface is in access modeSwitch(config-if)#switchport moSwitch(config-if)#switchport mode ? access Set trunking mode to ACCESS unconditionally dynamic Set trunking mode to dynamically negotiate
8、 access or trunk mode trunk Set trunking mode to TRUNK unconditionallySwitch(config-if)#switchport mode trSwitch(config-if)#switchport mode trunk ? Switch(config-if)#switchport mode trunk Switch(config-if)#swSwitch(config-if)#switchport ? access Set access mode characteristics of the interface mode
9、Set trunking mode of the interface native Set trunking native characteristics when interface is in trunking mode nonegotiate Device will not engage in negotiation protocol on this interface port-security Security related command trunk Set trunking characteristics of the interface voice Voice applian
10、ce attributesSwitch(config-if)#switchport trSwitch(config-if)#switchport trunk ? allowed Set allowed VLAN characteristics when interface is in trunking mode native Set trunking native characteristics when interface is in trunking modeSwitch(config-if)#switchport trunk alSwitch(config-if)#switchport
11、trunk allowed ? vlan Set allowed VLANs when interface is in trunking modeSwitch(config-if)#switchport trunk allowed vlSwitch(config-if)#switchport trunk allowed vlan ? WORD VLAN IDs of the allowed VLANs when this port is in trunking mode add add VLANs to the current list all all VLANs except all VLA
12、Ns except the following none no VLANs remove remove VLANs from the current listSwitch(config-if)#switchport trunk allowed vlan alSwitch(config-if)#switchport trunk allowed vlan all ? Switch(config-if)#switchport trunk allowed vlan all Switch(config-if)#下面我们来看下配置:Switch#show running-config Building c
13、onfiguration.Current configuration : 1488 bytes!version 12.2no service password-encryption!hostname Switch!interface FastEthernet0/1 switchport access vlan 10!interface FastEthernet0/2 switchport access vlan 10!interface FastEthernet0/3 switchport access vlan 10!interface FastEthernet0/4 switchport
14、access vlan 10!interface FastEthernet0/5 switchport access vlan 10!interface FastEthernet0/6 switchport access vlan 10!interface FastEthernet0/7 switchport access vlan 10!interface FastEthernet0/8 switchport access vlan 10!interface FastEthernet0/9 switchport access vlan 10!interface FastEthernet0/10 switchport access vlan 10!interface FastEthernet0/11 switchport access vlan 20!interface FastEthernet0/12 switchport