《计算机网络实验程序源代码.doc》由会员分享,可在线阅读,更多相关《计算机网络实验程序源代码.doc(6页珍藏版)》请在金锄头文库上搜索。
1、1交换机端口与mac地址绑定SwitchenSwitch#configConfiguring from terminal, memory, or network terminal? Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#Switch(config)#int vlan 1Switch(config-if)#ip add 192.168.1.1 255.255.255.0Switch(config-if)#no sh%LINK-5-CHANGED: Interface Vlan1, ch
2、anged state to upSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upSwitch(config-if)#exitSwitch(config-if)#switchport mode access Switch(config-if)#switchport port-security Switch(config-if)#switchport port-security mac-address 0007.EC41.68E0Switch#sh port-s
3、ecurity address Secure Mac Address Table-VlanMac AddressTypePortsRemaining Age(mins)-10007.EC41.68E0SecureConfiguredFastEthernet0/1-Total Addresses in System (excluding one mac per port) : 0Max Addresses limit in System (excluding one mac per port) : 1024Switch#2.用交换机划分vlan并添加端口SwitchenSwitch#config
4、Configuring from terminal, memory, or network terminal? Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#vlan 3Switch(config-vlan)#exitSwitch(config)#int range f0/1-2Switch(config-if-range)#sw mod accSwitch(config-if-range)#sw ac
5、c vlan 2Switch(config-if-range)#exitSwitch(config)#int range f0/3-4Switch(config-if-range)#sw mod accSwitch(config-if-range)#sw acc vlan 3Switch(config-if-range)#exitSwitch(config)#int vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to upSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on
6、Interface Vlan2, changed state to upSwitch(config-if)#no shSwitch(config-if)#exitSwitch(config)#int vlan 3%LINK-5-CHANGED: Interface Vlan3, changed state to upSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to upSwitch(config-if)#no shSwitch(config-if)#ZSwitch#
7、%SYS-5-CONFIG_I: Configured from console by consoleSwitch#sh vlan VLAN Name Status Ports- - - -1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23, Fa0/242 VLAN0002 active Fa0/1, Fa0/23 VLAN000
8、3 active Fa0/3, Fa0/41002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2- - - - - - - - - - -1 enet 100001 1500 - - - - - 0 02 enet 100002 1500 - - - - - 0 03 en
9、et 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -Switch#3.相同vlan的跨交换机通信SwitchSwitchenSwitch#configConfiguring from term
10、inal, memory, or network terminal? Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#Switch(config)#Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int f0/1Switch(config-if)#sw mod accSwitch(config-if)#sw acc vlan 2Switch(config-if)#exitSwitch(config)#vlan 3Switc
11、h(config-vlan)#exitSwitch(config)#int f1/1Switch(config-if)#sw mod accSwitch(config-if)#sw acc vlan 3Switch(config-if)#exitSwitch(config)#int vlan 2Switch(config-if)#%LINK-5-CHANGED: Interface Vlan2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#exitSwitch(config)#int vlan 3Switch(config-if)#%LINK-5-CHANGED: Interface Vlan3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to upSwitch(config-if)#exitSwitch(config)#int f2/1