H3C常用配置命令,网络路由命令-宜昌电脑耗材网
最新商讯
·宜昌打印机清零 EPSON打印机清零 佳能打印机清零 收...
·华硕办公本a豆灵耀顽石飞行堡垒20191110报价
·打印机加粉的过程当中,应该要保证哪几个方面呢?
·西数 希捷 纽曼 东芝联想移动硬盘20191110报价
·宜昌激光电视安装技术,上门安装激光电视,网购激光电视安装
更多>> 
最近浏览过的商品
还没有浏览过的商品。
 H3C常用配置命令,网络路由命令

H3C常用配置命令
1、进入视图模式。
    system-view
2、开启Telnet并设置登陆密码。
   2.1、telnet server enable
   2.2、user-interface vty 0 4
   2.3、authentication-mode password
    2.4、set authentication password simple 123456
    2.5、user privilege level 3

3、创建Vlan、删除Vlan。

    3.1、Vlan 250  这就创建了Vlan250。
    3.2、Undo Vlan 250 这就删除了Vlan250。
4、为交换机设置Telnet连接IP,删除IP。
     4.1、先进入具体的Vlan中(拿Vlan250举例)。
     interface vlan 250
   4.2、为其设置IP。
     ip address 192.168.2.250 255.255.255.0  也可这样设置 p add 192.168.2.250 24
   4.3、删除IP。
    undo ip address
5、端口加Vlan。
   5.1、先进入具体的端口中。
        int gig1/0/1
   5.2、通过port access命令将其加入到vlan中。
    port access vlan 250  这样就将其加入到具体的vlan 250中了。
6、改变端口模式,普通口变trunk口。
   6.1、先进入具体的端口中。
    int gig1/0/24
   6.2、通过link-type 改变其模式。
    port link-type trunk
   6.3、然后通过permit 命令加在所有的vlan下。
    port trunk permit vlan all
7、trunk口变成普通口。
   7.1、先进入具体端口。
    int gig1/0/24
   7.2、通过access命令将其设置为普通口。
    port link-type access
8、保存命令。
   save
9、重启交换机命令。
     reboot
10、恢复出厂设置。
   reset saved-configuration
11、常见错误:
  11.1、有时候你把一个新的交换机回复出厂设置的时候,他会默认为vlan 1带一个IP(如192.168.2.101),而这个时候你又不想要这个ip,这个时候你会通过 undo ip address来删除IP,哈哈,这个方法是删除               不了的,删除方法如下。
      解决办法:
          a)、先通过interface进入具体的Vlan 1 中。
        interface vlan 1
      b)、为其修改IP地址。
            ip address 192.168.2.111 24
      c)、通过undo再次删除Vlan中的IP。
        undo ip add
      d)、删除成功,然后你再进入其他的具体Vlan,为其设置IP地址即可。
        ......EnD
 
  a -- 由硬件结合实现数据的高速转发。

  b -- 这就不是简单的二层交换机和路由器的叠加,三层路由模块直接叠加在二层交换的高速背板总线上,突破了传统路由器的接口速率限制,速率可达几十Gbit/s。算上背板带宽,这些是三层交换机性能的两个重要参数。

  c -- 简洁的路由软件使路由过程简化。

  d -- 大部分的数据转发,除了必要的路由选择交由路由软件处理,都是又二层模块高速转发,路由软件大多都是经过处理的高效优化软件,并不是简单照搬路由器中的软件。
  三层交换机的配置命令

  步骤一:给交换机配置IP地址

  S2724G#conf

  S2724G(config)#int vlan 1

  S2724G(config-if)#ip addess 192.168.0.100 255.255.255.0

  ----给VLAN 1配置IP地址

  S2724G(config-if)#no shutdown ----激活该VLAN接口

  S2724G(config-if)#exit

  S2724G(config)#ip default-gateway 192.168.0.1 ----指定交换机的网关地址

  步骤二:创建VLAN

  S2724G#conf

  S2724G(config)#vlan 10 ----创建VLAN 10

  S2724G(config-vlan)#exit

  S2724G(config)# vlan 20 ----创建VLAN 20

  S2724G(config-vlan)#exit

  步骤三:把相应接口指定到相应的VLAN中

  S2724G(config)#int gi 0/10

  S2724G(config-if)#switch access vlan 10

  ----把交换机的第10端口划到VLAN 10中

  S2724G(config-if)#exit

  S2724G(config)#int gi 0/20

  S2724G(config-if)#switch access vlan 20

  ----把交换机的第20端口划到VLAN 20中

  S2724G(config-if)#exit

  S2724G(config)#int gi 0/24

  S2724G(config-if)#switch mode trunk

  ----设置24口为Trunk模式(与三层交换机的连接口

  S2724G(config-if)#

  步骤四:保存配置

  S2724G(config-if)#end

  S2724G#write

  模式转换命令

  用户模式----特权模式,使用命令“enable”

  特权模式----全局配置模式,使用命令“config t”

  全局配置模式----接口模式,使用命令“interface+接口类型+接口号”

  全局配置模式----线控模式,使用命令“line+接口类型+接口号”

  注:

  用户模式:查看初始化的信息。

  特权模式:查看所有信息、调试、保存配置信息

  全局模式:配置所有信息、针对整个路由器或交换机的所有接口

  接口模式:针对某一个接口的配置

  线控模式:对路由器进行控制的接口配置

  (2)配置命令

  show running config 显示所有的配置

  show versin 显示版本号和寄存器值

  shut down 关闭接口

  no shutdown 打开接口

  ip add +ip地址 配置IP地址

  secondary+IP地址 为接口配置第二个IP地址

  show interface+接口类型+接口号 查看接口管理性

  show controllers interface 查看接口是否有DCE电缆

  show history 查看历史记录

  show terminal 查看终端记录大小

  hostname+主机名 配置路由器或交换机的标识

  config memory 修改保存在NVRAM中的启动配置

  exec timeout 0 0 设置控制台会话超时为0

  service password-encryptin 手工加密所有密码

  enable password +密码 配置明文密码

  ena sec +密码 配置密文密码

  line vty 0 4/15 进入telnet接口

  password +密码 配置telnet密码

  line aux 0 进入AUX接口

  password +密码 配置密码

  line con 0 进入CON接口

  password +密码 配置密码

  bandwidth+数字 配置带宽

  no ip address 删除已配置的IP地址

  show startup config 查看NVRAM中的配置信息

  copy run-config atartup config 保存信息到NVRAM

  write 保存信息到NVRA

  erase startup-config 清除NVRAM中的配置信息

  show ip interface brief 查看接口的谪要信息

  banner motd # +信息 + # 配置路由器或交换机的描素信息

  description+信息 配置接口听描素信息

  vlan database 进入VLAN数据库模式

  vlan +vlan号+ 名称 创建VLAN

  switchport access vlan +vlan号 为VLAN为配接口

  interface vlan +vlan号 进入VLAN接口模式

  ip add +ip地址 为VLAN配置管理IP地址

  vtp+service/tracsparent/client 配置SW的VTP工作模式

  vtp +domain+域名 配置SW的VTP域名

  vtp +password +密码 配置SW的密码

  switchport mode trunk 启用中继

  no vlan +vlan号 删除VLAN

  show spamming-tree vlan +vlan号 查看VLA怕生成树议

  2. 路由器配置命令

  ip route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由

  show ip route 查看路由表

  show protocols 显示出所有的被动路由协议和接口上哪些协议被设置

  show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用

  的定时器

  等信息

  router rip 激活RIP协议

  network +直连网段 发布直连网段

  interface lookback 0 激活逻辑接口

  passive-interface +接口类型+接口号 配置接口为被动模式

  debug ip +协议 动态查看路由更新信息

  undebug all 关闭所有DEBUG信息

  router eigrp +as号 激活EIGRP路由协议

  network +网段+子网掩码 发布直连网段

  show ip eigrp neighbors 查看邻居表

  show ip eigrp topology 查看拓扑表

  show ip eigrp traffic 查看发送包数量

  router ospf +process-ID 激活OSPF协议

  network+直连网段+area+区域号 发布直连网段

  show ip ospf 显示OSPF的进程号和ROUTER-ID

  encapsulation+封装格式 更改封装格式

  no ip admain-lookup 关闭路由器的域名查找

  ip routing 在三层交换机上启用路由功能

  show user 查看SW的在线用户

  clear line +线路号 清除线路

  3. 三层交换机配置命令

  配置一组二层端口

  configure terminal 进入配置状态

  nterface range {port-range} 进入组配置状态

  配置三层端口

  configure terminal 进入配置状态

  interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-

  channel port-channel-number} 进入端口配置状态

  no switchport 把物理端口变成三层口

  ip address ip_address subnet_mask 配置IP地址和掩码

  no shutdown 激活端口

  例:

  Switch(config)# interface gigabitethernet0/2

  Switch(config-if)# no switchport

  Switch(config-if)# ip address 192.20.135.21 255.255.255.0

  Switch(config-if)# no shutdown

  配置VLAN

  configure terminal 进入配置状态

  vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改

  name vlan-name 可选)输入一个VLAN名,如果没有配置VLAN名,缺省的名字是VLAN号前面用0填满

  的4位数,如VLAN0004是VLAN4的缺省

  名字

  mtu mtu-size (可选) 改变MTU大小

  例

  Switch# configure terminal

  Switch(config)# vlan 20

  Switch(config-vlan)# name test20

  Switch(config-vlan)# end

  或

  Switch# vlan database

  Switch(vlan)# vlan 20 name test20

  Switch(vlan)# exit

  将端口分配给一个VLAN

  configure terminal 进入配置状态

  interface interface-id 进入要分配的端口

  switchport mode access 定义二层口

  switchport access vlan vlan-id 把端口分配给某一VLAN

  例

  Switch# configure terminal

  Enter configuration commands, one per line. End with CNTL/Z.

  Switch(config)# interface fastethernet0/1

  Switch(config-if)# switchport mode access

  Switch(config-if)# switchport access vlan 2

  Switch(config-if)# end

  Switch#

  配置VLAN trunk

  configure terminal 进入配置状态

  interface interface-Id 进入端口配置状态

  switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装ISL 或 802.1Q 或

  自动协商

  switchport mode {dynamic {auto | desirable} | trunk} 配置二层trunk模式。

  dynamic auto—自动协商是否成为trunk

  dynamic desirable—把端口设置为trunk如果对方端口是trunk, desirable, 配置Native VLAN

  (802.1q)

  或自动模式,trunk—设置端口为强制的trunk方式,而不理会对方端口是否为trunk

  switchport access vlan vlan-id 可选) 指定一个缺省VLAN, 如果此端口不再是trunk

  switchport trunk native vlan vlan-id 指定802.1Q native VLAN号

  例:

  Switch# configure terminal

  Enter configuration commands, one per line. End with CNTL/Z.

  Switch(config)# interface fastethernet0/4

  Switch(config-if)# switchport mode trunk

  Switch(config-if)# switchport trunk encapsulation dot1q

  Switch(config-if)# end

  定义TRUNK允许的VLAN

  configure terminal子 进入配置状态

  interface interface-id 进入端口配置

  switchport mode trunk 配置二层口为trunk

  switchport trunk allowed vlan {add | all | except | remove} vlan-list可选) 配置trunk允

  许的VLAN.使用add, all, except, remove关健字

  no switchport trunk allowed vlan 允许所有VLAN通过

  例

  Switch(config)# interface fastethernet0/1

  Switch(config-if)# switchport trunk allowed vlan remove 2

  Switch(config-if)# end

  配置Native VLAN(802.1q)

  configure terminal 进入配置状态

  interface interface-id 进入配置成802.1qtrunk的端口

  switchport trunk native vlan vlan-Id 配置native VLAN号

  no switchport trunk native vlan 端口配置命令回到缺省的状态

  配置基于端口权值的负载均衡

  configure terminal 进入Switch 1配置状态

  vtp domain domain-name 配置VTP域

  vtp mode server 将Switch 1配置成VTP server.

  show vtp status 验证VTP的配置

  show vlan 验证VLAN

  configure terminal 进入配置状态

  interface fastethernet 0/1 进入F0/1端口

  switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk

H3C Switch命令:
一、模式命令:
1. 用户模式:Switch>
2. 特权模式:Switch>enable
Switch#
3. 全局配置模式:Switch#config terminal
Switch(config)#
4. 接口配置模式:Switch(config)#interface fastethernet0/1
Switch(config-if)#
5. Line模式:Switch(config)#line console 0
Switch(config-line)#
二、特权模式下的命令:
1. 查看机MAC地址:Switch#show mac-address-table
2. 发现(CDP):
Switch#show cdp
Switch#show cdp interface fastethernet0/1
Switch#show cdp neighbors
Switch#show cdp neighbors detail
Switch#show cdp entry
3. 保存机配置:
Switch#copy running-config startup-config或者Switch#write
4. 恢复交换机出厂值:
Switch#erase startup-config
Switch#reload
三、全局配置模式下的命令:
1. 配置主机名:Switch(config)#hostname Sw1
Sw1(config)#
2、 设置登陆台密码:Switch(config)#line console 0
Switch(config-line)#password 密码
Switch(config-line)#login
3. 使能口令:Switch(config)#enable Password 密码
4. 加密保存的使能口令:Switch(config)#enable secret 密码
5. 配置IP地址:
Switch(config)#interface vlan 1
Switch(config-if)#ip address IP地址 网关
Switch(config-if)#no shutdown
6. 配置交换机网关:Switch(config)#ip default-gateway 网关
四、VLAN配置命令:
1. 创建vlan命令:
a) 全局配置模式下:
Switch(config)#vlan 2
Switch(config)#name v2
Switch(config)#mtu 数值
Switch(config)#end
b) Vlan数据库下:
Switch#vlan database
Switch#vlan 2 name v2
Switch#vlan 2 mut 数值
Switch#exit
2. 删除vlan命令:
a) 全局配置模式下:
Switch(config)#no vlan 2
Switch(config)#end
b) Vlan数据库下:
Switch#no vlan 2 name v2
Switch#exit
3. 在vlan中添加端口:
Switch#config terminal
Switch(config)#interface f0/1(端口)
Switch(config-if)#Switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
一次将多个端口添加到vlan中:
Switch#config terminal
Switch(config)#interface range f0/1 - 5(端口)
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
注:switch#show vlan biref(查看vlan信息)
4. 配置vlan trunk:
1. 配置接口为trunk命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport mode trunk
2. 配置接口为动态协商模式的命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#switchport mode dynamic desirable/auto
3. 从trunk中删除vlan:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport trunk allowed vlan remove 2
4. 在trunk中添加vlan:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport trunk allowed vlan add 2
-----------------------------------------------------------
Catalyst 2950交换机密码恢复
(1)拔下交换机的电源。
(2)用手按再交换机的MODE按键上,插上电源线。
(3)看到控制台出现如下提示,松开MODE建。
switch:
(4)再switch:后执行flash_init命令。
(5)查看Flash中的文件。
(6)把config.text文件改名为config.old文件。
(7)执行boot命令,启动交换机。
(8)进入特权模式查看flash里的文件。
(9)把文件config.old改为config.text文件。
(10)把config.text复制为系统的running-config.
(11)进入配置模式重新设置密码并存盘,密码恢复完成。

 

发布日期:2020/5/22
  宜昌打印机维修 复印机 一体机上门维修热线:13677173728 邢师傅 0717-6736581
 
购物指南
选择配送方式
付款收货
挑选商品
送货说明
购物流程
订购方式
注意事项
支付方式
货到付款区域
支付方式说明
货到付款
扫码支付
服务政策
售后服务
退换货原则
其他服务协议
服务中心
关于我们
关于我们

宜昌电脑耗材网  版权所有 Copyright©2014-2020  Www.Ycoaw.Com ALL Rights Resrved ;商务QQ:7533615
产品信息 - 资料 - 上传 - 新品牌报价 - 行业新闻投信箱sysharp@126.com  0717-6736581 
宜昌市福瑞电脑科技有限公司   鄂ICP备18013266号  鄂公网安备:42050202000383号
文章版权归原作者所有如有侵权请立即与我们联系,我们将及时处理

客服中心
扫描上面二维码即可
访问手机版购物商城
耗材:0717-6736581
维修:13677173728

展开客服
友情链接平台 网站地图 ALEXA