网工 华为命令

1交换机基本配置

2路由器基本配置

3交换机vlan配置

4路由器rip协议配置

5路由器ospf配置

6路由器dhcp配置

7路由器acl配置

8路由器nat配置

9三层交换vlan路由

10单臂路由vlan通信

system-view

sysname        

quit / return

sysname zyw

user-interface console 0  //进入控制台

authentication-mode password   /验证模式 采用password密码认证 还有aaa认证

set authentication password cipher zyw5683 //配置密码密文的密码

              配置远程管理ip地址

interface vlanif 1

ip add 192.168.1.254 24   //配置ip

undo shutdown  //开启接口

dns domain zyw.com   //配置域名

dns server 192.168.254.254  //配置域名ip

dis vlan 显示vlan   save保存配置

dis curr  显示当前的配置    reboot重启设备

undo terminal monitor    //取消提示信息

un in en  //取消控制台提示

三,配置交换机端口的速率,双工,arp

int g0/0/1   

description dtwlxy //端口描述

undo negotiation auto   //取消协商

duplex full     //全双工

auto duplex full   //自动

speed 10  //速率10m

auto speed 100   //自动

quit

arp static 192.168.1.8 5489-98cf-2603   //绑定

dis arp //查看arp

dis arp all

四,配置路由器接口ip和静态路由

int g0/0/01

ip address 192.168.1.6 24

undo shutdown  //开启

配置静态路由

ip route-static 192.168.20.0 24 10.0.12.2

ip route-static 192.168.10.0 24 serial 0/0/1

ip route-static  0.0.0.0 0  192.168.1.5  //默认路由

dispaly ip routing-table   //查看路由表

五,配置交换机vlan

vlan 10

description zyw   //vlan描述

vlan batch 30 40     //创建多个vlan

vlan batch  2 to 20

int g0/0/1  进入接口

port link-type access   //访问口

port default vlan 10   //让0/0/1加入vlan 10

如果创建错了  undo port default vlan 

进入0/0/2口

port link-type trunk //干道口

port trunk allow-pass vlan 10 20

port trunk allow-pass vlan all

进入 e0/0/2

port link-type hybrid //混合口

port hybrid untagged vlan 20  //去标签

port hybrid pvid vlan 2   //设置默认的vlan

port trunk allow-pass vlan 10 to 100

dis port vlan

dispaly vlan

六,配置交换机vlan一致性gvrp    双向注册

normal模式  类似服务器模式

gvrp   //开启

fixed模式     类似客户机模式

gvrp registration fixed   //registration注册

forvidden模式  类似透明模式

gvrp registration forbidden 

display vlan summary //查看vlan的汇总

display gvrp status //查看gvrp状态

七,配置路由器的rip协议

rip  //启用rp默认v1

network 192.168.1.0   //发表直连网段

version 2 //配置v2版本

dis rip 

dis rip database    //查看rip数据库

dis ip routing-rable  //查看路由表

优先级:直连0 静态60  rip 100   ospf 10/150

八,配置路由器ospf协议

ospf 1   //启动ospf默认进程是1

area 0    //进入区域0

network 192.168.3.0 0.0.0.255   //发布直连网段  反演码  a(acl),o(ospf),e(eigrp思科的),i(ipsec) 四个地方用反演码

silent-interface g0/0/2  //被动接口

quit

dis ospf interface   //查看ospf通告

dis ospf peer  //查看ospf邻居

dis IP routing-table   查看路由表

dis ospf routing  查看ospf的路由表

九,配置基于全局的dhcp协议

dhcp enable   开启dhcp

ip pool zyw   //一个叫zyw的地址池

network 192.168.1.0  

lease day 2  //租约默认是一天

gateway-list 192.168.1.254   //网关

excluded-ip-address 192.168.1.250 192.168.1.253  排除ip范围

dns-list 8.8.8.8     dns服务器

quit

进入0/0/1

dhcp select global    //基于全局

十,配置基于接口的dhcp协议

dhcp enable 

int g0/0/1

dhcp select interface //基于接口

dhcp select lease day 2

dhcp server excluded-ip-address 192.168.1.1 192.168.1.10   //excluded 排除

dhcp server dns-list 8.8.8.8 //dns

quit

dis ip pool

十一,配置路由器基本acl :2000-2999

acl基本的东西

time-range satime 8:00 to 18:00 working-day

acl 2000

rule 5 permit source 1.1.1.1 0  //允许原ip  反演码0   默认步长5

rule 10 deny any    //允许完之后要拒绝所有的

quit

user-interface vty 0 4   //进入虚拟接口   要多个user

acl 2000 inbound     //应用acl

dis acl all    

dis acl 200    查看acl 2000

十二,高级 acl  3000-3999

acl 3000   配置高级acl

rule permit ip source 1.1.1.1 0 destination 4.4.4.4 0   

quit

user-interface vty 0 4    //进入虚拟的接口

acl 3000 outbound  //应用acl

quit

int g0/0/1    //进入实体的接口

traffic-filter inbound acl 3000

dis acl all

十三,配置路由器动态nat   多对少

nat address-group 1 202.169.10.50 202.169.10.60    //外部ip    1 是他的名字

acl 2001   //配置acl    acl 作用  过滤 抓流量

rule 5 permit source 172.17.1.0 0.0.0.255     //内部ip

quit

int g0/0/1

nat outbound 2001 address-group 1 no-pat  //应用nat     outbound是外   2001是内

dis nat outbound 查看nat

十四,配置路由器静态nat  一对一

int g0/0/1

nat static global 202.169.10.5 inside 172.16.1.1   //一对一转换   用于服务器一对一的

配置路由器动态napt(多对一)

int g0/0/0

nat outbound 2001     //多对一转换

dis nat static   

十五,配置三层交换机vlan间路由

int vlanif 10 

ip add 192.168.1.254 24

quit

int vlanif 20

ip add 192.168.2.254 24

dis ip interface brief

dis port vlan 

dis vlan

十六,单臂路由vlan间通信

int g0/0/1.1  // 子接口

ip add 192.168.1.254 24

dot1q termination vid 10   //封装

arp broadcast enable   //开启arp

quit

dis ip interface brief   //查看接口

dis ip routing-table

display current-configuration    //简写dis cu

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值