单臂路由

实验拓扑:
pc0属于vlan10 pc1属于vlan20
要求pc0和pc1能够相互通信
 
配置route
Router(config-if)#int f0/0.1
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to upRouter(config-subif)#enc
Router(config-subif)#encapsulation dot1q ?
  <1-1005>  IEEE 802.1Q VLAN ID
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip add 192.168.21.1 255.255.255.0
Router(config-subif)#exit
Router(config)#int f0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to upRouter(config-subif)#enc
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip add 192.168.32.2 255.255.255.0
配置switch
Switch(config)#int f0/1
Switch(config-if)#no sh
Switch(config-if)#switchp
Switch(config-if)#switchport mode trun
Switch(config-if)#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
Switch(config-if)#exit
Switch(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Switch#vlandata
Translating "vlandata"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address
Switch#
Switch#
Switch#
Switch#
Switch#vlan data
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 10
VLAN 10 added:
    Name: VLAN0010
Switch(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int f0/2
Switch(config-if)#switch
Switch(config-if)#switchport acc vlan 10
Switch(config-if)#int f0/3
Switch(config-if)#swi acc vlan 20
配置pc机
pc0的ip地址为10.10.10.10 255.255.255.0
网关为 192.168.21.1
pc1的ip地址为10.10.20.10 255.255.255.0
网关为 192.168.32.2
 

你可能感兴趣的:(职场,休闲,单臂路由)