H3C交换机简单配置

用户模式
system-view 进入配置模式
System View: return to User View with Ctrl+Z.
[H3C]
language-mode chinese 配置中文显示
Change language mode, confirm? [Y/N]y


创建VLAN 20 并将2到10号端口划入该VLAN
[H3C]VLAN 20 创建VLAN 20
[H3C-vlan20]PORT Ethernet 1/0/2 to Ethernet 1/0/10 划分VLAN 20的物理接口
[H3C-vlan20]int vlan 20 创建VLAN 20的三层接口
[H3C-Vlan-interface20]ip add 192.168.10.88 24 配置VLAN 20的三层地址
[H3C-Vlan-interface20]qui


将1号接口作成TRUNK口
[H3C]int eth 1/0/1 进入物理接口
[H3C-Ethernet1/0/1]port link-type trunk 配置成TRUNK
[H3C-Ethernet1/0/1]undo port trunk permit vlan 1 裁剪(不允许)通过该接口
Please wait... Done.
[H3C-Ethernet1/0/1]port trunk permit vlan 1205 2205 只允许VLAN 1205 2205通过
Please wait... Done.
[H3C-Ethernet1/0/1]



DLDP配置:
[H3C]dldp enable 全局启用DLDP
DLDP is enabled on all fiber ports except fabric ports.
[H3C]dldp work-mode enhance 全局启用DLDP增强模式
[H3C]dldp interval 5 DLDP的发包的间隔时间的配置
[H3C]int eth 1/0/1
[H3C-Ethernet1/0/1]dldp enable 启用接口的DLDP功能
DLDP is enabled on the port Ethernet1/0/1.
[H3C-Ethernet1/0/1]


配置WEB登陆:
[H3C]local-user web
New local user added.
[H3C-luser-web]password cip admin
[H3C-luser-web]le 3
[H3C-luser-web]service-type telnet

限制仅有某IP地址可以进行WEB管理:
如仅允许10.121.131.97可以进行WEB管理
[H3C]acl number 2001
[H3C-acl-basic-2001]
[H3C-acl-basic-2001]rule 10 permit source 10.121.131.97 0
[H3C-acl-basic-2001]qui
[H3C-acl-basic-2001]qui
[H3C]
[H3C]ip http acl 2001
[H3C]





保存配置:
save
The configuration will be written to the device.
Are you sure?[Y/N]y
Please input the file name(*.cfg)(To leave the existing filename
unchanged press the enter key):
Now saving current configuration to the device.
Saving configuration. Please wait...
........
Unit1 save configuration flash:/config.cfg successfully



清空配置:
reset saved-configuration
The saved configuration will be erased.
Are you sure?[Y/N]y
Configuration in flash memory is being cleared.
Please wait ...
...
Unit1 reset saved-configuration successfully.
reboot
Start to check configuration with next startup configuration file,
please wait......
This command will reboot the device. Current configuration may be lost in next startup if you continue. Continue? [Y/N] y
This will reboot device. Continue? [Y/N] y
#Apr 2 01:02:49:369 2000 hel

lo COMMONSY/5/REBOOT:- 1 -
Reboot Fabric by command.







SSH配置:

步骤1:命名交换机名称
[H3C]sysname
步骤2:创建加密KEY
[H3C]rsa local-key-pair create
Confirm to replace them? [Y/N]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 1024]:
Generating keys...
......++++++
...........................................................++++++
....................++++++++
........++++++++
......Done!
[H3C]
步骤3:创建SSH用户名和密码
[H3C]local-user ssh
[H3C-luser-ssh]password cip ssh
[H3C-luser-ssh]service-type ssh
[H3C-luser-ssh]level 3
步骤4:指定SSH登陆用户名
[H3C]ssh user ssh authentication-type password
步骤5:配置VTY窗口只能进行SSH登陆
[H3C]user-interface vty 0 4
[H3C-ui-vty0-4]authentication-mode scheme
[H3C-ui-vty0-4]protocol inbound ssh



备注:
[H3C]display current-configuration 查看当前运行的配置
[H3C]display saved-configuration 查看被保存的配置
[H3C]display this 查看当前配置模式下的配置


[H3C]display brief interface 简要查看交换机上所有接口信息
Interface:
Eth - Ethernet GE - GigabitEthernet TENGE - tenGigabitEthernet
Loop - LoopBack Vlan - Vlan-interface Cas - Cascade
Speed/Duplex:
A - auto-negotiation

Interface Link Speed Duplex Type PVID Description
--------------------------------------------------------------------------------
Aux1/0/0 UP -- -- -- --
Eth1/0/1 DOWN A A trunk 1
Eth1/0/2 DOWN A A access 20
Eth1/0/3 DOWN A A access 20
Eth1/0/4 DOWN A A access 20
Eth1/0/5 DOWN A A access 20
Eth1/0/6 DOWN A A access 20
Eth1/0/7 DOWN A A access 20
Eth1/0/8 DOWN A A access 20
Eth1/0/9 DOWN A A access 20
Eth1/0/10 DOWN A A access 20
Eth1/0/11 UP A100M Afull access 1
Eth1/0/12 DOWN A A access 1
Eth1/0/13 DOWN A A access 1
Eth1/0/14 UP A100M Ahalf access 1
Eth1/0/15 DOWN A A access 1
Eth1/0/16 UP A100M Afull access 1
Eth1/0/17 DOWN A A access 1
Eth1/0/18 UP A100M Afull access 1
Eth1/0/19 DOWN A A access 1
Eth1/0/20 UP A100M Afull access 1
Eth1/0/21 DOWN A A access 1
Eth1/0/22 UP A100M Afull access 1
Eth1/0/23 DOWN A A access 1
Eth1/0/24 DOWN A A access 1
GE1/1/1 DOWN A A access 1
GE1/1/2 DOWN A A

access 1
GE1/1/3 DOWN A A access 1
GE1/1/4 DOWN A A access 1
NULL0 UP -- -- -- --
Vlan1 UP -- -- -- --
Vlan20 DOWN -- -- -- --
[H3C]

[H3C]display interface Ethernet 1/0/1 查看1号接口的详细信息
Ethernet1/0/1 current state : DOWN
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 000f-e275-14f0
Media type is twisted pair, loopback not set
Port hardware type is 100_BASE_TX
Unknown-speed mode, unknown-duplex mode
Link speed type is autonegotiation, link duplex type is autonegotiation
Flow-control is not enabled
The Maximum Frame Length is 9216
Broadcast MAX-ratio: 100%
Unicast MAX-ratio: 100%
Multicast MAX-ratio: 100%
Allow jumbo frame to pass
PVID: 1
Mdi type: auto
Port link-type: trunk
VLAN passing
VLAN permitted: 1205
Trunk port encapsulation: IEEE 802.1q
Last 300 seconds input: 0 packets/sec 0 bytes/sec
Last 300 seconds output: 0 packets/sec 0 bytes/sec
Input(total): 5226 packets, 526697 bytes
253 broadcasts, 17 multicasts, 0 pauses
Input(normal): - packets, - bytes
- broadcasts, - multicasts, - pauses
Input: 3 input errors, 0 runts, 0 giants, - throttles, 0 CRC
0 frame, - overruns, 3 aborts, 0 ignored, - parity errors
Output(total): 5454 packets, 936279 bytes
527 broadcasts, 1640 multicasts, 0 pauses
Output(normal): - packets, - bytes
- broadcasts, - multicasts, - pauses
Output: 0 output errors, - underruns, - buffer failures
0 aborts, 0 deferred, 0 collisions, 0 late collisions
0 lost carrier, - no carrier

[H3C]

相关文档
最新文档