Cisco 基础命令
ccnp吧
全部回复
仅看楼主
level 1
大麦穗520 楼主
Clearing Configuration Inforamtion
    You can clear the configruation infromation from the startup configruation. If you reboot the switch with no startup configuration, the switch enters the setup program so that you can reconfigure the switch with all new settings.
Clearing the Startup Configuration File
    To clear the contents of your statup configurtaion.use the erase nvram: or erase statup-config privileged EXEC command.
Deleting a Stored Configruation File
   To delete a saved configuration from flash memeory,use the delete flash: filename privileged EXEC command. Depending on the setting of the file prompt global configuration command. you might be prompted for configuration before you delete a file.By default, the switch prompts for configuration on destructive file operations. For more iformation about the file prompt command.see the cisco ios command reference for release 12.2
switch# erase startup-config
switch# erase nvram
switch# delete vlan.dat
switch(config)#service password-encryption
(optional) Encrypt the password when the password is defined or when the configuration is written.
Encryption prevents the password from being readable in the configuration file.
switch(config)#enable secret
switch(config)#eanble password
switch(config)# username name [privilege level] {password encryption-type password}
Enter the username, privilege level, and passowrd for each user.
For name, specify the user ID as one word, Spaces and quotation marks are not allowed.
(optional) For level, specify the privilege level the suer has after gaining access.The range is 0 to 15.Level 15 give privileged EXEC mode access.Level 1 gives user EXEC mode access.
For encryption-type ,enter 0 to specify that an unencrypted password will follow, Enter 7 to specify that a hidden password will follow.
For password,specify the password the user must enter to gain access to the switch.The password must be from 1 to 25 characters,can contain embeded spaces,and must be the last option specified in the username command.
switch(config)# ip routing
switch(config)# ip subnet-zero
system mtu routing bytes  
(optional) Change the system MTU for routed prots.The range is 1500 to the system MTU value.the maximum MTU that can be routed for all ports.
Although larger packets can be accepted. they cannot be routed.
no aaa new-model
To disable AAA,use the no aaa new-modul global configure command.To disable AAA authentication, use the no aaa authenication login {default | list-name} method1 [ method2..] global
confgiuration command.To either disable TACACS+ authentication for logins or to return to the default vlaue. use the no login authentication {default |list-name } line configuration command.
switch(cofig)# hostname xxx
switch# configure termianl
switch(config)# interface fasterthernet 0/1
switch(config-if)#no switchport

2011年05月18日 02点05分 1
level 1
大麦穗520 楼主
switch(config-if)#description test
switch(confg-if)#ip add 1.1.1.1 255.255.255.0
switch(config-if)#ip add 2.2.2.2 255.255.255.0 secondary
switch(config-if)# duplex full
switch(config-if)#speed 100
switch(config-if)#no shutdown
switch#conf t
switch(config)#interface fastethernet 0/2
switch(config-if#description test
switch(config-if)#switchport mode access
switch(config-if)#switchport access vlan 123
switch(confgi-if)#speed 100
switch(config-if)#duplex full
switch(config)#interface fastetherent 0/48
switch (config-if)# description   test
switch(config-if)# switchport trunk encapsulation dot1q
switch(config-if)# switchport turnk allwoed vlan 1, 2 , 5-8
swtich(config-if)#switchport mode turnk
swtich(config-if)#speed 100
switch(config-if)#duplex full
confgiurate terminal       
Enter global configuation mode.
interface interface-id  
Specity the port to be configured, and enter interface configuration mode.
swtichport mode trunk
Configure the interface as a VLAN trunk port.
switchport turnk allowed vlan {add| all |except | remov} vlan-list
(optional)configure the list of VLANs allowed on the trunk.
For explanations about using the add,all,except, and remove keywords, see the command reference for this   release.
The vlan-list parameter is either a single Vlan number from 1 to 4094 or a range of VLANS described by two VLAN numbers, the lower one first , spearated by a hyphen.Do not enter any spaces between comma-spearated VLAN paratmeters or in hyphen-specified ranges. ALL VLANs
are allowed by default.
end
show interface interface-id swithport  
verify your entries in the Trunking VLANs Enabled field of the display.
copy running-config statup-config  
(optional) Save your entries in the configuration file.
switch(config)#interface vlan 123
switch(config-if)#description test
switch(config-if)#ip add 1.1.1.1 255.255.255.0
switch(config-if)#ip add 2.2.2.2. 255.255.255.0 secondary
no ip classless
disable classless routing behavior
ip classless routing
switch(config)# router ospf 1
switch(config-router)# network 1.1.1.1 0.0.0.0 area 0
switch#conf t
switch(config)# router sopf process-id
Eanable OSPF routing ,and enter router configuration mode.The process ID is an internally used identification parameter that is locally assigned and can be any positive integer.Each OSPF routing
process has a unique value.
network address wildcard-mask area area-id
Define an interface on which OSPF runs and the area ID for that interface.You can use the wildcard mask as a single command to define one or more interfaces to be associated with a specific OSPF area. The area ID can be decimal value or an IP address.
show ip portocols  
verify your entries.
copy running-config statup-config

2011年05月18日 02点05分 2
1