文档库 最新最全的文档下载
当前位置:文档库 › 交换机配置

交换机配置

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#interface range f0/1 - 8
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#exit
Switch(config)#spanning-tree mode pvst
Switch(config)#interface range f0/1 - 8
Switch(config-if-range)#spanning-tree portfast
Switch(config-if-range)#exit
Switch(config)#interface f0/24
Switch(config-if)#no switchpor
Switch(config-if)#ip address 10.155.2.2 255.255.255.252
Switch(config-if)#duplex full
Switch(config-if)#speed 100
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#interface vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

Switch(config-if)#ip address 10.155.5.30 255.255.255.240
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#line vty 0 4
Switch(config-line)#enable password cisco
Switch(config)#line vty 0 4
Switch(config-line)#login
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
Switch(config-line)#password cisco
Switch(config-line)#transport input telnet
Switch(config-line)#exit
Switch(config)#ip routing
Switch(config)#interface loopback0
Switch(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

Switch(config-if)#ip address 10.155.5.1 255.255.255.255
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#router ospf 100
Switch(config-router)#router-id 10.155.5.1
Switch(config-router)#network 10.155.2.2 0.0.0.0 area 100
Switch(config-router)#network 10.155.5.1 0.0.0.0 area 100
Switch(config-router)#network 10.155.5.30 0.0.0.0 area 100
Switch(config-router)#exit
Switch(config)#exit
Switch#wr

相关文档