分类: 系统运维
2011-12-08 15:39:42
- - 是以前内容的延伸不懂可以参看 VLAN 划分详细 这里没有配置VTP
3
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#vlan data
% 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 name redhatd1
VLAN 2 added:
Name: redhatd1
Switch(vlan)#vlan 3 name redhatd2
VLAN 3 added:
Name: redhatd2
Switch(vlan)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/1
Switch()#sw a vlan 2
Switch(config-if)#int f0/2
Switch(config-if)#sw a vlan 3
Switch(config-if)#int f0/3
Switch(config-if)#sw mo a
Switch(config-if)#sw mo tr
Switch4
Switch>en
Switch#vlan da
% 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 name redhatd1
VLAN 2 added:
Name: redhatd1
Switch(vlan)#vlan 3 name redhatd2
VLAN 3 added:
Name: redhatd2
Switch(vlan)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#sw a
Switch(config-if)#sw access vlan 2
Switch(config-if)#int f0/2
Switch(config-if)#sw access vlan 3
Switch(config-if)#int f0/3
Switch(config-if)#sw m t
Switch(config-if)#sw m trunk
Switch(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/4, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
Switch(config-if)#int f0/4
Switch(config-if)#sw m trunk
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
Router4
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 10.1.1.1 255.0.0.0
Router(config-if)#no ip add
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
int f0/0.1 //子接口
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up
Router(config-subif)#ip add 192.168.1.254 255.255.255.0
% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.
Router(config-subif)#enc d 2
Router(config-subif)#ip add 192.168.1.254 255.255.255.0
Router(config-subif)#int f0/0.3
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.3, changed state to up
Router(config-subif)#enc d 3
Router(config-subif)#ip add 192.168.2.254 255.255.255.0
Router(config-subif)#