H3C交换机基本配置

H 3C 交换机基本配置

 

 

<Quidway>system     进入特权模式sys

[Quidway]sysname S3026       配置系统名为S3026             

[S3026]super password 111    配置超级用户密码

 

恢复交换机出厂设置:

reset saved-configuration   清除启动配置

reboot    重启

 

进入远程登陆配置模式               

[S3026]user-interface vty 0 4   

[S3026-ui-vty0-4]authentication-mode password        远程登陆使用密码认证

[S3026-ui-vty0-4]set authentication-mode password simple 222   设置密码

[S3026-ui-vty0-4]user privilege level 3        用户权限级别为3(超级用户)

[S3026-ui-vty0-4]quit    退出该模式

[S3026]quit       退出特权模式 

 

配置telnet(vty) 用户使用本地口令

[S3026]local-user admin  添加Telnet用户,设置用户名为admin

[S3026-luser-admin]service-type telnet level 3 (设置管理级别为3即超级用户)

[S3026-luser-admin]password simple admin   设置密码为admin

[S3026]display current-configuration  显示当前配置   dis curr

[S3026]user-interface vty 0 4     进入远程登陆配置模式

[S3026-ui-vty0-4]authentication-mode scheme        使用本地认证

[S3026]quit       退出特权模式 

 

配置ssh(vty) 用户使用本地口令

[S3026]local-user admin

[S3026-luser-admin]password simple  “password”

[S3026-luser-admin]service-type ssh level 3

[S3026]rsa local-key-pair create

[S3026]ssh user “username” service-type all

[S3026]ssh user “username” authentication-type pass

[S3026]user-interface vty 4

[S3026-ui-vty0-4]authentication-mode scheme

[S3026-ui-vty0-4]protocol inbound ssh

 

Vlan管理

 

[S3026]interface vlan1    (进入管理VLAN,默认的ID1

[S3026-Vlan-interface1]undo ip address    (取消管理VLAN原有的IP地址)

[S3026-Vlan-interface1]ip address 192.168.1.234 255.255.255.0    (配置以太网交换机管理VLANIP地址,建议与管理PC终端在同一网段)

[S3026-Vlan-interface1]quit 退出该模式

 

[S3026]vlan 2     创建VLAN 2 

[S3026-vlan2]int vlan 2   进入VLAN 接口2

[S3026vlan2-interface2]ip address 192.168.0.1 255.255.255.0 VLAN2配置IP地址

[S3026-vlan2]port ethernet0/2  把端口e0/2设置到vlan2

[S3026-vlan2]port e0/4 to et0/6  把端口e0/4 0/5 0/6设置到vlan2

[S3026-vlan2]quit    退出该模式

[S3026]dis vlan  显示VLAN配置情况

 

[S3026]int e0/3  进入端口e0/3

[S3026-Ethernet1]port access vlan 2   把该端口分配到vlan2 

[S3026-Ethernet1]quit退出该模式

[S3026]dis vlan 显示VLAN配置情况 

[S3026]dis curr显示当前配置

 

 

[S3026]int e0/4       进入端口e0/4

[S3026-Ethernet0/4]port link-type trunk            上行端口设置成trunk属性

[SwitchB-Ethernet0/3]port trunk permit vlan all    允许所有vlan透传

[SwitchB-Ethernet0/3]port trunk permit vlan vlanid   允许具体的vlan通过

 

基本路由

 

[S3026]ip default-gateway 10.65.1.2    配置默认网关

[S3026]ip route 40.0.0.0 255.0.0.0 2.0.0 .11        配置静态路

[S3026]ip route-static 0.0.0 .0 0.0.0.0 10.65.1.2   配置默认路由

[S3026]ip route-static 192.168.2.0 24 75.55.0.10

[S3026]dis ip routing-table       查看路由表

 

 

端口的安全

 

[H3C] port-security enable 使能端口的安全功能。

 

[H3C] interface Ethernet1/0/1

[H3C-Ethernet1/0/1] port-security port-mode autolearn 配置端口的安全模式为 autolearn

[H3C-Ethernet1/0/1] port-security max-mac-count 100 端口允许接 MAC地址数为 100

[H3C-Ethernet1/0/1]am user-bind mac-addr 00e0-fc00-5102 ip-addr 10.153.1.2 将端口和IP地址绑定

[H3C]am user-bind mac-addr 00e0-fc00-5101 ip-addr 10.153.1.1 interface Ethernet1/0/1                                 端口绑定

[H3C-Ethernet1/0/1] mac-address security 0001-0001-0001 vlan 1 Security MAC地址添加到 VLAN 1

[S3026]save       保存配置

 

DHCP功能

 

[S3026]dhcp enable    全局时能DHCP功能

[S3026]dhcp server ip-pool h3c  创建DHCP地址池

[S3026-dhcp -pool-h3c]network 192.18.0.1 mask 255.255.255.0    配置动态分配的IP地址围

[S3026-dhcp -pool-h3c] expired day 3 有效期

[S3026-dhcp -pool-h3c]gateway-list 192.168.0.1   网关地址

[S3026-dhcp -pool-h3c]dns-list 221.3.131.118   DNS地址

[S3026]dhcp server forbidden-ip 192.168.0.1    配置某个地址为不可分配地址

[S3026]dhcp select global interface vlan-interface 2    指定VLAN2虚接口工作在全局地址模式下

 

[Switch]interface Vlan-interface 3   配置VLAN接口3IP地址

[Switch-Vlan-interface1]ip address 192.168.0.1  24

[Switch-Vlan-interface1]dhcp select interface

 配置VLAN接口1工作在DHCP接口地址池模式下,并分配192.168.0.0/24网段的IP地址

[Switch-Vlan-interface1]dhcp server static-bind ip-address 192.168.0.10 mac-address 000D-88F7-0001

                        配置接口地址池中的静态绑定地址

[Switch-Vlan-interface1]dhcp server expired day 10   有效期

[Switch-Vlan-interface1]dhcp server dns-list 192.168.0.20   DNS服务器地址

[Switch-Vlan-interface1]dhcp server nbns-list 192.168.0.30   WINS服务器地址

 

 

 

你可能感兴趣的:(职场,h3c,基本配置,休闲,交换机)