Skip to content

笔记

img

2.配置第一台交换机

Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#ip routing

Switch(config)#vlan 10
Switch(config-vlan)#ex

Switch(config)#vlan 20
Switch(config-vlan)#ex

Switch(config)#interface fa0/1
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex

Switch(config)#interface fa0/2
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 20
Switch(config-if)#ex

Switch(config)#interface fa0/3
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
Switch(config-if)#ip address 192.168.7.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#ex

Switch(config)#interface vlan 10
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#ex

Switch(config)#interface vlan 20
Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#ex

Switch(config)#interface fa0/3
Switch(config-if)#ip address 192.168.7.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#ex

Switch(config)#route rip
Switch(config-router)#version 2
Switch(config-router)#network 192.168.1.0
Switch(config-router)#network 192.168.2.0
Switch(config-router)#network 192.168.7.0

3.配置第二台交换机

Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#vlan 30
Switch(config-vlan)#ex
Switch(config)#vlan 40
Switch(config-vlan)#ex
Switch(config)#interface fa0/1
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 30
Switch(config-if)#ex
Switch(config)#interface fa0/2
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 40
Switch(config-if)#ex
Switch(config)#interface fa0/3
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up	
Switch(config-if)#ip address 192.168.7.2 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#ex
Switch(config)#interface fa0/4
Switch(config-if)#no switchport 
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
Switch(config-if)#ip address 192.168.8.1 255.255.255.0
Switch(config-if)#no shutdown 
Switch(config-if)#ex