huawei.xmind

在这里插入图片描述

华为

华为
交换
查看所有配置
dis cur
进入全局模式
system-view
后退
quit
关闭信息中心
undo info-center enable
保存配置
save
清除所有配置
reset saved-configuration
telnet登录
SW1 配置文件 interface Vlanif1 ip address 192.168.1.10 255.255.255.0 [sw1]user-interface vty 0 4 [sw1-ui-vty0-4]authentication-mode password [sw1-ui-vty0-4]set authentication password simple 111 [sw1-ui-vty0-4]user privilege level 3 SW2 配置文件 interface Vlanif1 ip address 192.168.1.20 255.255.255.0 [sw2]user-interface vty 0 4 [sw2-ui-vty0-4]authentication-mode password [sw2-ui-vty0-4]set authentication password simple 111 [sw2-ui-vty0-4]user privilege level 3 telnet 192.168.1.10 用户密码登入 [Huawei]user-interface vty 0 4 [Huawei-ui-vty0-4]authentication-mode aaa #配置验证模式为aaa [Huawei-ui-vty0-4]quit #退出用户界面视图 [Huawei]aaa #进入aaa验证 [Huawei-aaa]local-user huawei password cipher huawei #设置登陆用户和密码 Info: Add a new user. [Huawei-aaa]local-user huawei privilege level 3 #配置用户级别 [Huawei-aaa]local-user huawei service-type telnet#配置用户登陆方式 最大连接数 user-interface maximum-vty 10
vlan
创建vlan
vlan 20
删除vlan
undo vlan 10
进入vlan配置ip
interface vlanif 10 ip address 192.168.1.1 255.255.255.0
基于协议的vlan
vlan 10 protocol-vlan ipv4 vlan 20 protocol-vlan ip v6 //配置端口类型及允许通过的协议VLAN。注意,与LSW2连接的G0/0/24端口要允许所有的协议VLAN通过,并且必须是Hybird类型。 int g 0/0/24 port hybrid tagged vlan 1 to 4094 int g 0/0/1 port hybrid untagged vlan 10 protocol-vlan vlan 10 0 priority 0 #
接口
进入接口
interface Ethernet 0/0/1 interface GigabitEthernet 0/0/1
配置接口模式
interface Ethernet 0/0/1 port link-type access port default vlan 10 interface Ethernet 0/0/2 port link-type trunk port trunk allow-pass vlan 10 20 port hybrid vlan 10 tag/untag //打标签 不打标签 四种类型的端口可以共存在一台以太网交换机上,但Trunk端口、Hybrid端口及Fabric口之间不能直接切换,只能先设为Access端口,再设置为其他类型端口。例如:Trunk端口不能直接被设置为Hybrid端口,只能先设为Access端口,再设置为Hybrid端口。
激活端口
undo shutdown
清除接口所有命令
clear configuration interface g0/0/x //全局下
交换机命名
sysname sw1
静态路由
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
端口
设置双工属性
inter gig 0/0/1 duplex full //全双工 duplex half //半双工
流量控制功能
inter gig 0/0/1 flow-control 开启流量控制功能后,如果本端交换机发生拥塞,它将向对端交换机发送消息,通知对端交换机暂时停止发送报文
速率
inter gig 0/0/1 auto speed 10/100/1000
端口环回口监测功能
loopback-detect enable //开启环回口监测 inter gig 0/0/1 loopback-detect enable //端口里开启环回口检测
发送环回数据包的时间间隔
loopback-detect packet-interval 5 //发送环回数据包时间间隔为5秒
链路聚合
inter eth-trunk1 trunkport GigabitEthernet 0/0/1 to 0/0/3 将接口加入eth-trunk mode lacp-static //为静态模式 inter gig 0/0/1 lacp priority 100 //优先级 优先级越小为主动端
配置链路聚合组活动接口数目的上限阈值。
max active-linknumber
端口安全
端口隔离
实现l2隔离 interface GigabitEthernet0/0/1 port-isolate enable group 1 interface GigabitEthernet0/0/2 port-isolate enable group 1 更改三层隔离 port-isolate mode L3 单向端口隔离配置(仅支持L2层隔离,L3层隔离是双向隔离)port-isolate mode L2 interface GigabitEthernet0/0/1 am isolate g0/0/2 阻止g0/0/1向g0/0/2发送数据,但允许g0/0/2发来的报文,只收不发。
限制最大mac地址
interface GigabitEthernet 0/0/1 mac-limit maximum 5 //限制最大学习5个mac地址 如果是0 的话表示没有限制
超过最大mac地址限制报警老化时间
mac-limit maximum 5 alarm enable [Huawei-GigabitEthernet0/0/3]port-security enable 打开端口安全功能 [Huawei-GigabitEthernet0/0/3]port-security max-mac-num 1 限制安全MAC地址最大数量为1个,默认为1 [Huawei-GigabitEthernet0/0/3]port-security aging-time 300 配置安全MAC地址的老化时间300s,默认不老化
生成树
stp enable
MSTP
主交换机 stp mode mstp //配置成mstpmos stp region-configuration //进入mstp配置模式 region-name huawei //配置域名huawei revision-level 1 //修订等级 instance 1 vlan 100 //将vlan10加入实例1 instance 2 vlan 200 //将vlan20 加入实例2 active region-configuration //激活配置 下面两个交换机 stp region-configuration region-name huawei revision-level 1 instance 1 vlan 100 instance 2 vlan 200 active region-configuration stp instance 1 root primary //将此交换机实例1设置为主根 stp instance 2 root secondary //将此交换机实例2设置为备根
VRRP
inter vlanif 10 vrrp vrid 1 virtual-ip 10.1.1.254 //备份组号1 虚拟ip地址 vrrp vrid 1 priority 120 //配置备份组的优先级 优先级越高,越会成为master设备。默认优先级是100. # interface Vlanif10 ip address 192.168.1.1 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.1.3//主备ip要一致 vrrp vrid 10 priority 200 # interface Vlanif20 ip address 172.16.1.4 255.255.255.0 vrrp vrid 10 virtual-ip 172.16.1.3 #
堆叠
stack port interface g0/0/28 enable //开启指定端口的堆叠端口功能 stack port interface g0/0/27 enable //开启指定端口的堆叠端口功能 interface stack-port0/1 //创建堆叠端口1 port member-group interface g0/0/28 //将端口g0、0/28加入到堆叠端口1 quit interface stack-port0/2 //创建堆叠端口2 port member-group interface g0/0/27 //将端口g0/0/27加入到堆叠端口2 quit 配置堆叠优先级 stack slot 0 priority 200 //堆叠id为0的优先级为200 ,默认优先级是100 优先级越大越优先 stack slot 0 reunmber 0 //修改swa堆叠ID为0 ,默认为0 堆叠配置完成后保存配置,并重启交换机 save reboot
DHCP
dhcp enable ip pool vlan10 gateway-list 192.168.1.254 network 192.168.1.0 mask 255.255.255.0 excluded-ip-address 192.168.1.200 192.168.1.253 lease day 5 dns-list 114.114.114.114
GVRP
上行链路监测
vrrp vrid 1 track interface GigabitEthernet 0/0/2 reduced 30 这里这条命令是监视S1的上行链路,如果断掉,优先级剪掉30
路由
管理
telnet
telnet的两台机器能互相ping通 r1 system-view sysname ar1ar1 super password cipher 123456 //设置密码 user-interface vty 0 4 //进入配置用户终端 authentication-mode password //回车后输入密码123456。 protocol inbound telnet //传入协议telnet user privilege level 10 //设置优先级 quit R2 telnet 192.168.1.1
查看路由表
display ip routing-table
VPN
GRE
R2: ip route-static 0.0.0.0 0 10.10.10.2 //加一条路由,使得两个公网IP互通 interface Tunnel0/0/0 //新建隧道 tunnel-protocol gre //隧道协议 source 10.10.10.1 //源地址 destination 10.10.20.1 //目标地址 ip add 192.168.254.1 24 //给隧道配置地址 quit ip route-static 192.168.12.0 255.255.255.0 192.168.254.2 //给隧道配置静态路由 需要注意的是:description(描述)和destination(目标地 址),很容易敲错。 R1 inter g0/0/1 ip add 10.10.10.2 24 inter g0/0、0 ip add 10.10.20.2 24 R3 ip route-static 0.0.0.0 0 10.10.20.2 interface Tunnel0/0/0 tunnel-protocol gre source 10.10.20.1 destination 10.10.10.1 ip add 192.168.254.1 24 quit ip route-static 192.168.11.0 255.255.255.0 192.168.254.1 https://blog.csdn.net/u012468770/article/details/95062948
keepalive
display keepalive packets count
ipsec
R1 ike proposal 1 encryption-algorithm 3des-cbc //指定加密算法 authentication-algorithm md5 //散列函数 authentication-method pre-share //认证方式为预共享密钥 dh group2 //DH组的长度为2 ike peer 200.0.0.1 v1 pre-shared-key simple hahui //带有文本的预共享密钥 ike-proposal 1 remote-address 200.0.0.1 //指定远程对等方的ip地址 quit acl number 3000 //创建acl编号 rule permit ip source 192.168.1.0 0.0.0.255 destination 10.0.0.0 0.0.0.255 //匹配感兴趣流 quit ipsec proposal 1 //配置ipsec安全协议 transform ah-esp //封装算法 quit ipsec policy hh 1 isakmp // 配置ipsec安全策略 security acl 3000 //匹配的感兴趣流 ike-peer 200.0.0.1 //对等体 proposal 1 //封装算法 q inter g0/0/0 ipsec policy hh //把ipsec调用到接口上 R3 ip route-static 0.0.0.0 0.0.0.0 200.0.0.2 ike proposal 1 encryption-algorithm 3des-cbc authentication-algorithm md5 authentication-method pre-share dh group2 q ike peer 100.0.0.1 v1 pre-shared-key simple hahui ike-proposal 1 remote-address 100.0.0.1 q acl number 3000 rule permit ip source 10.0.0.0 0.0.0.255 destination 192.168.1.0 0.0.0.255 q ipsec proposal 1 transform ah-esp q ipsec policy hh 1 isakmp security acl 3000 ike-peer 100.0.0.1 proposal 1 q inter g0/0/1 ipsec policy hh
路由
路由重发布
rip import-route ospf 1 //进入rip重发布ospf 1
RIP
rip version 2 //版本号rip2 (支持无类网络) undo summary //关闭自动汇总 network 1.0.0.0
OSPF
也可以直接ospf 1 不用跟router-id ospf 1 router-id 1.1.1.1 //进程号 router id area 12 //进入area区域 network 192.168.1.0 0.0.0.255 network 192.168.12.0 0.0.0.255 display ospf peer brief //查看ospf邻居
区域认证
只有一方配置了认证会导致邻居终端,要两边验证模式和一致 ospf 1 area 1 authentication-mode authentication-mode simple plain huawei1 //区域认证为简单模式 并配置plain参数。配置plain参数后,可以使得在查看配置文件时,口令均以明文方式显示。 dis this //查看ospf下配置 authentication-mode simple plain huawei1 //明文方式显示口令 authentication-mode simple huawei1 //没有plain authentication-mode simple cipher %%/F~SKKaTeX parse error: Expected ‘EOF’, got ‘#’ at position 1: #̲~h"😡!s<^Dpw1)8…%$ //口令密文形式显示
链路认证
int g 0/0/1 ospf authentication-mode md5 1 huawei5 //配置链路认证,MD5验证模式,标识符1,口令huawei5 一边配置会导致识别失败,要两边验证模式,标识符,口令保持一致)都配置后邻居又重新起来 同时配置接口认证和区域认证,会优先使用接口验证建立OSPF邻居
nssa
ospf 100 area 1 nssa nssa no-summary
BGP
ibgp
ibgp用lookback 地址建立邻居 bgp 100 router-id 7.7.7.7 peer 8.8.8.8 as-number 100 peer 8.8.8.8 connect-interface LoopBack0 //更新发送bgp报文的接口为lookback接口 network 1.1.1.1 32 用直连接口建 bgp 100 router-id 1.1.1.1 peer 10.0.12.2 as-number 200 //和邻居网络建立邻接关系 network 1.1.1.1 32 //宣告虚拟接口网络
EBGP
bgp 100 router-id 1.1.1.1 peer 192.168.1.2 as-number 200 network 1.1.1.1 32 bgp 200 router-id 2.2.2.2 peer 192.168.1.1 as-number 100 network 2.2.2.2 32 ebgp用lookback 地址建邻居 bgp 13 router-id 1.1.1.1 peer 2.2.2.2 as-number 24 与AR2建立ebgp邻居 peer 2.2.2.2 ebgp-max-hop 2 ebgp邻居允许的最大跳数修改为2(因为不是直连而是用loopback0接口) peer 2.2.2.2 connect-interface LoopBack0 更新发送bgp报文的接口为loopback0接口
选路
本地优先级
从R4去往R1的路由从R2改走R3 route-policy lop permit node 10 //创建名为lop的路由策略 Info: New Sequence of this List. apply local-preference 222 //设置本地优先级为222 quit //保存退出 bgp 200 //进入bgp 200 peer 10.0.34.1 route-policy lop export //应用策略 quit //保存退出 quit //退出到用户视图 reset bgp all //刷新路由属性 本地优先级越大越优先
MED
如果希望R1去往R4的路由改走R3,可以使用MED属性控制R1的路由选路,使R1去往R4从R2改走R3。默认情况下R1去R4的4.4.4.4走R2。通过在R2上修改MED属性并传出给R1,可以使R1去往R4的路由改走R3。 route-policy med permit node 10 //创建名为med的路由策略 Info: New Sequence of this List. apply cost + 500 //设置路由开销为500 quit //保存退出 bgp 200 //进入bgp200 peer 10.0.12.1 route-policy med export //应用策略 quit //保存退出
RR(路由反射器)
bgp 200 peer 193.1.1.2 reflect-client peer 194.1.1.2 reflect-client quit quit
静态路由
ip route-static 192.168.1.0 255.255.255.0 192.168.20.1
ACL
acl number 2000 //创建acl 2000 rule deny source 192.168.10.1 0 //拒绝源地址为192.168.10.1 的流量 int gi 0/0/1 traffic-filter outbound acl 2000 //接口下出方向调用acl 2000 拒绝所有的报文 acl number 3006 rule 5 deny ip
路由策略
route-policy StoO permit node 10 // StoO为命名;node 10 为节点 if-match interface GigabitEthernet0/0/0 apply cost 15 // 修改cost值 apply cost-type type-1 // 类型为1型 在ospf中引入路由策略: [R2-ospf-1]import-route direct route-policy StoO //direct为直连
单臂路由
interface GigabitEthernet0/0/0.20 dot1q termination vid 20 //封装dot1q协议,该子接口对应vlan 20 ip address 192.168.1.1 24 //设置子接口IP地址和子网掩码 arp broadcast enable //开启子接口的ARP广播
串口
PPP
ppp认证
PAP
R1 为PAP认证方 AAA LOCAL-USER hst password cipher 123 //配置一个本地用户hst LOCAL-USER HST service-type PPP //这个用户的服务类型为ppp INT S 2/0/0 link-protocol PPP //在华为S接口默认二层协议是PPP IP address 10.0.0.1 30 PPP authentication-mode PAP // 端口验证模式为PAP认证 R2 为PAP被认证方 INT S2/0/0 IP ADDRESS 10.0.0.2 30 ppp pap local-user hst password cipher 123 //在接口上配置一个本地认证用户hst
chap
R1为CHAP主认证方 int s 0/0/1 ppp chap user zzz ppp chap password cipher 123 ppp authentication chap R3 为chap被验证方 aaa local-user zzz password cipher 123 local-user zzz service-type ppp int S 0/0/1 PPP authentication-mode CHAP
PPP MP
aaa local-user ppp password cipher 123//用户名密码 local-user ppp service-type ppp//服务类型 interface Mp-group0/0/0 ip address 12.1.1.1 255.255.255.0//本接口ip地址,物理接口下就不用在配置ip地址了 主认证方 interface Serial0/0/0 link-protocol ppp ppp authentication-mode chap ppp mp Mp-group 0/0/0 被认证方 interface Serial0/0/0 link-protocol ppp ppp chap user ppp ppp chap password simple 123 ppp mp Mp-group 0/0/0
防火墙
service-manage en service-manage all permit
九月 08, 2021. Created by XMind

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值