1个拓扑和15个模块带你玩华为!!

网友投稿 257 2022-09-13


1个拓扑和15个模块带你玩华为!!

模块1:telnet配置(如果配置在接入层设备,如要给该接入层设备指定网关,实现不同网段可以远程telnet)system view :进入系统视图telnet server enable :开启telnetinterface vlanif 1 :进入vlanif 1ip address 192.168.1.1 24 :配置地址

user-interface vty 0 4 :进入vty0 4模式authentication-mode aaa :认证模式设置为aaaaaa :进入aaa模式local-user zhangsan password cipher pwd123 :建立用户zhangsanlocal-user zhangsan privilege level 15 :设置连接权限local-user zhangsan service-type telnet :设置连接方式为telnet

ip route-static 0.0.0.0 0 192.168.1.254 :配置一条默认路由指向网关

模块2:ssh配置system viewstelnet server enable :开启stelnet(也就是ssh)interface vlanif 1ip address 192.168.1.1 24

user-interafce vty 0 4 authentication-mode aaaprotocol inbound ssh :配置连接协议

aaalocal-user zhangsan password cipher pwd123local-user zhangsan privilege level 15local-user zhangsan service-type ssh :配置连接方式为ssh

ssh user zhangsan authentication-type password :zhangsan使用password认证ssh user zhangsan service-type stelnet :zhangsan使用stelnet连接

ip route-static 0.0.0.0 0 192.168.1.254

模块3:配置dhcp自动分配地址1)接口dhcp配置(接口dhcp存在一个局限性,会将接口ip当做dhcp客户端的网关;但是它的配置十分方便)dhcp enable :开启dhcp服务

int vlanif 1ip address 192.168.1.1 24dhcp select interface :dhcp查询方式为接口

2)全局dhcp配置dhcp enable

int vlanif 1ip address 192.168.1.1 24dhcp select global :dhcp查询方式为全局

ip pool vlan1 :定义地址池network 192.168.1.0 mask 24 :网段gateway-list 192.168.1.254 :网关地址dns-list 1.1.1.1 :dns解析服务器地址excluded-ip-address 192.168.1.2 :保留地址lease day 1 hour 1 :释放时间

模块4:vlan配置vlan batch 2 to 10 :创建vlan

interface g0/0/1 :进入接口port link-type access :配置接口为接入模式port default vlan 2 :分配vlan2给该接口

interface g0/0/2port link-type trunk :配置接口为中继模式port trunk allow-pass vlan 2 3 5 :该接口允许vlan2、3、5通信

模块5:eth-trunk配置(相当于cisco的channel-group)interface eth-trunk 1 :进入第一个eth-trunktrunkport g0/0/1 :将g0/0/1接口分给eth-trunk1

interface g0/0/2eth-trunk 1 :与上面操作一样

模块6:静态路由配置ip route-static 192.168.1.0 24 192.168.2.1 :先是目标网段、而后掩码、下一跳ip地址

模块7:ACL配置1)基本acl(可限制源ip,从2000~2999)acl 2000 :创建acl2000rule 5 deny source 192.168.1.0 0.0.0.255 :第5条拒绝192.168.1.0/24rule 10 permit source 192.168.0.0 0.0.255.255 :第10条允许192.168.0.0/16

interface g0/0/1 traffic-filter inbound acl 2000 :设置接口为acl2000的入接口

2)高级acl(可限制源ip、目标ip、源端口、目标端口,从3000~3999)acl 3000 :创建acl3000rule 5 deny tcp source 192.168.1.0 0.0.0.255 destination 172.16.0.0 0.0.255.255 destination port eq 21 :第5条拒绝从192.168.1.0/24 到172.16.0.0/16的TCP21端口 的流量。rule 10 permit tcp source 192.168.1.0 0.0.0.255 destination 172.16.0.0 0.0.255.255:第10条允许192.168.1.0/24到172.16.0.0的TCP流量;两者 结合起来就是允许除了TCP21 端口的其他TCP流量。

模块8:NAT配置1)内网上网NATacl 2000 rule 100 permit 192.168.0.0 0.0.255.255

interface g0/0/1 :进入路由器外网口nat outbound 2000 :配置为acl2000的内网出口

2)发布内网服务器的NATnat static global 202.1.1.1 inside 192.168.1.253 :配置转换202.1.1.1到192.168.1.253

nat server protocol tcp global 202.1.1.1 inside 192.168.1.253 8080:访问外网202.1.1.1的 TCP8080端口。模块9:mstp二层负载分担stp mode mstp :配置stp的模式为mstpstp region-configuration :进入mstp域视图 region-name test :配置mstp域的名称revision-level 1 :配置修订级别instance 1 vlan 10 instance 2 vlan 20 :配置mstp实例,并分配vlanactive region-configuration :激活配置

stp instance 1 priority 4096 stp instance 2 priority 8192 :实例的优先级

模块10:vrrp三层负载分担master设备:interface vlanif 10 :进入vlanif10ip address 192.168.1.1 24 :配置地址vrrp vrid 10 virtual-ip 192.168.1.254 :配置虚拟ip地址vrrp vrid 10 priority 150 :优先级vrrp vrid 10 track interface g0/0/1 reduced 100 :端口追踪

backup设备:interface vlanif 10ip address 192.168.1.2 24 vrrp vrid 10 virtual-ip 192.168.1.254 :配置虚拟ip(其余不用配置, vrrp中也有占先权,默认开启, 不用管)

模块11:rip距离矢量路由rip :rip模式version 2 :使用2版本network 192.168.1.0 :宣告192.168.1.0/24网段

interface g0/0/1 rip metricin 2 :配置接口度量值(跳数)undo rip output :关闭发送rip通告undo rip input :关闭接收rip通告

slient-interface g0/0/1 :静默接口

rip split-horizon :水平分割rip poison-reverse :毒性逆转

display rip :查看rip配置

default-route originate :分发默认路由

模块12:ospf链路状态路由ospf 1 router-id 1.1.1.1 :配置ospf的router-idarea 0 :配置为area0区域network 192.168.1.0 0.0.0.255 :宣告网段

display ospf peer :查询ospf邻居状态

模块13、GRE ×××interface tunnel 1 :编辑1号隧道tunnel-protocol gre :隧道使用GRE协议ip address 192.168.1.1 30 :隧道地址source 202.0.0.1 :隧道源(本地外网接口)地址destination 101.0.0.1 :隧道对端(外网接口)地址

ip route-static 192.168.20.0 255.255.255.0 tunnel 0/0/1 :隧道路由(目标公司的网段)

ospf 1 router-id 1.1.1.1 area 0network 192.168.10.0 0.0.0.255network 192.168.1.0 0.0.0.255 :配置ospf(要让总部和分支机构网络连成一个整体,就需要互通路由。如果配置动态路由,就需要在宣告路由的时候将隧道地址也一起宣告)

模块14、IPsec ×××ike proposal 2 encryption-algorithm 3des-cbcauthentication-algorithm MD5authentication-method pre-sharedh group5sa duration 10000 :定义第一阶段的安全策略

ipsec proposal 5 esp authentication-algorithm sha1esp encryption-algorithm aes-128 :定义第二阶段的安全策略

ike peer to-fenzhi v1 :定义对等集信息(to-fenzhi为名称)pre-shared-key simple 123456 :设置协商密钥,两端需一致remote-address 202.1.1.1 :对端的外网接口地址

acl 3000rule permit ip source 10.0.0.0 0.255.255.255 destination 20.0.0.0 0.255.255.255 :设置acl3000定义感兴趣的数 据流(也就是需要通过隧道的 数据流)

ipsec policy abc 10 isakmp :定义使用IKE协商IPsecsecurity acl 3000 :调用acl3000ike-peer to-fenzhi :调用对等体集proposal 5 :调用第二阶段

interface g0/0/0 ipsec policy abc :在接口调用IPsec策略

acl 3001rule 100 deny ip source 10.0.0.1 0.255.255.255 destination 20.0.0.1 0.255.255.255rule 200 permit ip source 10.0.0.0 0.255.255.255 destination any:配置一条上网3001(拒绝转 换需要通过隧道的数据流,允许 其他所有)

interface g0/0/0nat outbound 3001 :将外网接口设置为nat转换的 接口

模块15(重点模块):display命令的使用。(display相当于cisco的show命令,我粗略的数了一下,华为3260路由器的系统视图下“display?”,大概有254个对象,可见这个命令多么重要。但是我们只需掌握一些常用的即可。简单举例出我日常的总结)

display this :常用命令,查看当前视图、模 式下的配置display current-configuration :查看当前配置display saving-configuration :查看以保存配置display aaa :查看aaa认证配置display acl number :acl规则display dhcp :dhcp配置display eth-trunk number :eth-trunk口下配置display firewall group :防火墙相关display interface g|e// :接口下配置display ipsec :查看ipsec相关display lldp neighbor brief :查看lldp邻接display mac-address :mac地址display ospf 1 * :ospf相关 display vrrp :vrrp信息display vlan brief :查看vlan信息display ip routing-table :查看路由表


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:HUAWEI无线部署802.1认证(华为认证wlan)
下一篇:PKI server and client configuration example.(pki体系的基本原理)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~