<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>网络 on AIHugoBlog</title>
    <link>/categories/%E7%BD%91%E7%BB%9C/</link>
    <description>Recent content in 网络 on AIHugoBlog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sun, 28 Apr 2024 14:17:28 +0800</lastBuildDate>
    <atom:link href="/categories/%E7%BD%91%E7%BB%9C/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>华为交换机通过ftp备份配置文件</title>
      <link>/posts/hua-wei-jiao-huan-ji-tong-guo-ftp-bei-fen-pei-zhi-wen-jian/</link>
      <pubDate>Sun, 28 Apr 2024 14:17:28 +0800</pubDate>
      <guid>/posts/hua-wei-jiao-huan-ji-tong-guo-ftp-bei-fen-pei-zhi-wen-jian/</guid>
      <description>&lt;ol&gt;
&lt;li&gt;ftp服务开启及账号建立sysftp server enableaaalocal-user jgsteelftp password cipher xxxxxxxxlocal-user jgsteelftp privilege level 3local-user jgsteelftp servi&lt;/li&gt;
&lt;/ol&gt;
</description>
    </item>
    <item>
      <title>华为AP修改fat和fit模式</title>
      <link>/posts/hua-wei-ap-xiu-gai-fat-he-fit-mo-shi/</link>
      <pubDate>Fri, 01 Dec 2023 15:00:33 +0800</pubDate>
      <guid>/posts/hua-wei-ap-xiu-gai-fat-he-fit-mo-shi/</guid>
      <description>&lt;h3 id=&#34;远程进入ap配置默认是开启stelnet的&#34;&gt;远程进入AP配置，默认是开启Stelnet的。&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;stelnet IP
# 登录会创建账号密码
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;查看当前ap模式&#34;&gt;查看当前AP模式&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;display version
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;设置ap模式&#34;&gt;设置AP模式&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ap-mode-switch fit
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;ac中查看ap连接状态&#34;&gt;AC中查看ap连接状态&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dis ap all
dis arp | include mac地址
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>IPv4内网保留网段</title>
      <link>/posts/ipv4-nei-wang-bao-liu-wang-duan/</link>
      <pubDate>Fri, 13 Jan 2023 16:05:01 +0800</pubDate>
      <guid>/posts/ipv4-nei-wang-bao-liu-wang-duan/</guid>
      <description>&lt;h3 id=&#34;a类地址&#34;&gt;A类地址&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;10.0.0.0/8
10.0.0.0 - 10.255.255.255
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;b类地址&#34;&gt;B类地址&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;172.16.0.0/12
172.16.0.0 - 172.31.255.255
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;c类地址&#34;&gt;C类地址&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;192.168.0.0/16
192.168.0.0 - 192.168.255.255
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>华为交换机清空所有配置</title>
      <link>/posts/hua-wei-jiao-huan-ji-qing-kong-suo-you-pei-zhi/</link>
      <pubDate>Fri, 13 Jan 2023 16:03:55 +0800</pubDate>
      <guid>/posts/hua-wei-jiao-huan-ji-qing-kong-suo-you-pei-zhi/</guid>
      <description>&lt;h3 id=&#34;1-首先通过串口线与交换机的console连接登陆该交换机&#34;&gt;1. 首先通过串口线与交换机的console连接登陆该交换机&lt;/h3&gt;
&lt;h3 id=&#34;2不需要进入sys可以直接在现有的状态下输入命令然后选择y&#34;&gt;2.不需要进入sys，可以直接在现有的状态下输入命令,然后选择Y&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;reset saved-configuration
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;3此时配置已经清空现在进行重启操作输入reboot并在接下来的第一个询问中选择n第二个询问中选择y等待交换机重启&#34;&gt;3.此时配置已经清空，现在进行重启操作。输入reboot，并在接下来的第一个询问中选择“N”，第二个询问中选择“Y”等待交换机重启。&lt;/h3&gt;</description>
    </item>
    <item>
      <title>华为交换机开启3a认证（ssh）</title>
      <link>/posts/hua-wei-jiao-huan-ji-kai-qi-3a-ren-zheng-ssh/</link>
      <pubDate>Fri, 13 Jan 2023 16:02:56 +0800</pubDate>
      <guid>/posts/hua-wei-jiao-huan-ji-kai-qi-3a-ren-zheng-ssh/</guid>
      <description>&lt;h3 id=&#34;创建一个账户为is密码为xxx&#34;&gt;创建一个账户为is，密码为xxx&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
#创建用户

aaa

local-user is password cipher xxx

local-user is privilege level 15    #最高权限

local-user is service-type ssh    #走ssh协议

quit
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
#创建ssh user

ssh user is authentication-type password   #is用户的认证方式为密码认证

ssh user is service-type stelnet      #stelnet实际上就是ssh
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
#创建本地秘钥对

rsa local-key-pair create
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
#启用ssh服务

stelnet server enable
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
#配置vty界面支持的登录协议

user-interface vty 0 4

authentication-mode aaa    #认证方式为3a

protocol inbound ssh       #允许ssh登录
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>华为设备配置console口参数</title>
      <link>/posts/hua-wei-she-bei-pei-zhi-console-kou-can-shu/</link>
      <pubDate>Fri, 13 Jan 2023 16:02:13 +0800</pubDate>
      <guid>/posts/hua-wei-she-bei-pei-zhi-console-kou-can-shu/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;user-interface console 0
authentication-mode password
set authentication password cipher
idle-timeout 20 0 #设置空闲超时时间为20分钟，默认10分钟
display this #查看配置结果
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>H3C新建用户并设置系统最高权限</title>
      <link>/posts/h3c-xin-jian-yong-hu-bing-she-zhi-xi-tong-zui-gao-quan-xian/</link>
      <pubDate>Fri, 13 Jan 2023 16:00:48 +0800</pubDate>
      <guid>/posts/h3c-xin-jian-yong-hu-bing-she-zhi-xi-tong-zui-gao-quan-xian/</guid>
      <description>&lt;h3 id=&#34;1配置登录管理的用户名认证级别口令&#34;&gt;1.配置登录管理的用户名、认证级别、口令&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;local-user admin
password simple satelit
service-type telnet
level 3
save
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;2h3c提权&#34;&gt;2.H3C提权&lt;/h3&gt;
&lt;p&gt;超级终端（基础密码system）&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;super 3
sys
local-user admin
password simple system #设置密码为system
level 3
service-type telnet
save
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;3修改h3c的默认密码&#34;&gt;3.修改H3C的默认密码&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;telnet 172.21.100.1
password:   #输入原密码
super 3
system
user-int vty 0 4   #改telnet密码
user-int console 0  #改console口密码
user-int aux 0   #改aux口密码
set aut pass cip abcde #设置密码
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>华为防火墙配置跨三层MAC识别</title>
      <link>/posts/hua-wei-fang-huo-qiang-pei-zhi-kua-san-ceng-mac-shi-bie/</link>
      <pubDate>Fri, 13 Jan 2023 14:34:20 +0800</pubDate>
      <guid>/posts/hua-wei-fang-huo-qiang-pei-zhi-kua-san-ceng-mac-shi-bie/</guid>
      <description>&lt;h1 id=&#34;华为防火墙配置跨三层mac识别&#34;&gt;华为防火墙配置跨三层MAC识别&lt;/h1&gt;
&lt;h3 id=&#34;1需求&#34;&gt;1.需求&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;FW作为企业的出口网关，内网用户通过三层交换机与FW相连，并通过FW访问Internet。FW需要以MAC地址为匹配条件配置安全策略、策略路由、带宽策略等来控制内网流量。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;拓扑图
&lt;img alt=&#34;image-1673591649298&#34; loading=&#34;lazy&#34; src=&#34;/upload/2023/01/image-1673591649298.png&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;2-s5700交换机为例&#34;&gt;2. S5700交换机为例&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;开启snmp&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[Switch] snmp-agent
[Switch] snmp-agent sys-info version v2c
[Switch] snmp-agent community read Public@123
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;3-防护墙配置&#34;&gt;3. 防护墙配置&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;配置FW的接口IP地址。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[FW] interface GigabitEthernet 1/0/2
[FW-GigabitEthernet1/0/2] ip address 192.168.2.100 24
[FW-GigabitEthernet1/0/2] quit
[FW] firewall zone trust
[FW-zone-trust] add interface GigabitEthernet 1/0/2
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置Local到Trust区域的安全策略，允许防火墙向交换机发送SNMP报文。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[FW] security-policy
[FW-policy-security] rule name policy_sec
[FW-policy-security-rule-policy_sec] source-zone local
[FW-policy-security-rule-policy_sec] destination-zone trust
[FW-policy-security-rule-policy_sec] destination-address 192.168.2.110 32
[FW-policy-security-rule-policy_sec] action permit
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置跨三层MAC识别。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[FW] snmp-server arp-sync enable
[FW] snmp-server target-host arp-sync address 192.168.2.110 community Public@123 v2c
[FW] snmp-server arp-sync interval 5 timeout 3
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>华为防火墙和三层交换机对接上网配置</title>
      <link>/posts/hua-wei-fang-huo-qiang-he-san-ceng-jiao-huan-ji-dui-jie-shang-wang-pei-zhi/</link>
      <pubDate>Fri, 13 Jan 2023 11:59:57 +0800</pubDate>
      <guid>/posts/hua-wei-fang-huo-qiang-he-san-ceng-jiao-huan-ji-dui-jie-shang-wang-pei-zhi/</guid>
      <description>&lt;h3 id=&#34;1需求&#34;&gt;1.需求&lt;/h3&gt;
&lt;p&gt;公司拥有多个部门且位于不同网段，各部门均有访问Internet需求。现要求用户通过三层交换机和防火墙访问外部网络，且要求三层交换机作为用户的网关。
拓扑图
&lt;img alt=&#34;image-1673582386613&#34; loading=&#34;lazy&#34; src=&#34;/upload/2023/01/image-1673582386613.png&#34;&gt;&lt;/p&gt;
&lt;h3 id=&#34;2-配置交换机&#34;&gt;2. 配置交换机&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;配置连接用户的接口和对应的VLANIF接口。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;HUAWEI&amp;gt; system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 2 3
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type access   //配置接口接入类型为access
[Switch-GigabitEthernet0/0/2] port default vlan 2   //配置接口加入VLAN 2
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] port link-type access
[Switch-GigabitEthernet0/0/3] port default vlan 3   
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface vlanif 2
[Switch-Vlanif2] ip address 192.168.1.1 24
[Switch-Vlanif2] quit
[Switch] interface vlanif 3
[Switch-Vlanif3] ip address 192.168.2.1 24
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置连接防火墙的接口和对应的VLANIF接口。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[Switch] vlan batch 100
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type access
[Switch-GigabitEthernet0/0/1] port default vlan 100   
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface vlanif 100
[Switch-Vlanif100] ip address 192.168.100.2 24
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置缺省路由。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[Switch] ip route-static 0.0.0.0 0.0.0.0 192.168.100.1   //缺省路由的下一跳是防火墙接口的IP地址192.168.100.1
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置DHCP服务器。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[Switch] dhcp enable   
[Switch] interface vlanif 2
[Switch-Vlanif2] dhcp select interface   //DHCP使用接口地址池的方式为用户分配IP地址
[Switch-Vlanif2] dhcp server dns-list 114.114.114.114 223.5.5.5   //配置的DNS-List 114.114.114.114是公用的DNS服务器地址，是不区分运营商的。在实际应用中，请根据运营商分配的DNS进行配置
[Switch-Vlanif2] quit
[Switch] interface vlanif 3
[Switch-Vlanif3] dhcp select interface
[Switch-Vlanif3] dhcp server dns-list 114.114.114.114 223.5.5.5
[Switch-Vlanif3] quit
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;3配置防火墙&#34;&gt;3.配置防火墙&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;配置连接交换机的接口对应的IP地址。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;USG6600&amp;gt; system-view
[USG6600] interface gigabitethernet 1/0/1
[USG6600-GigabitEthernet1/0/1] ip address 192.168.100.1 255.255.255.0 
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置连接公网的接口对应的IP地址。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[USG6600] interface gigabitethernet 1/0/2
[USG6600-GigabitEthernet1/0/2] ip address 1.1.1.2 255.255.255.0   //配置连接公网接口的IP地址和公网的IP地址在同一网段
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置缺省路由和回程路由。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[USG6600] ip route-static 0.0.0.0 0.0.0.0 1.1.1.1   //配置静态缺省路由的下一跳指向公网提供的IP地址1.1.1.1
[USG6600] ip route-static 192.168.0.0 255.255.0.0 192.168.100.2   //配置回程路由的下一跳就指向交换机上行接口的IP地址192.168.100.2
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置安全策略&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[USG6600] firewall zone trust   //配置trust域
[USG6600-zone-trust] add interface gigabitethernet 1/0/1
[USG6600-zone-trust] quit
[USG6600] firewall zone untrust   //配置untrust域
[USG6600-zone-untrust] add interface gigabitethernet 1/0/2
[USG6600-zone-untrust] quit
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置安全策略，允许域间互访。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[USG6600] security-policy
[USG6600-policy-security] rule name policy1
[USG6600-policy-security-rule-policy1] source-zone trust
[USG6600-policy-security-rule-policy1] destination-zone untrust
[USG6600-policy-security-rule-policy1] source-address 192.168.0.0 mask 255.255.0.0
[USG6600-policy-security-rule-policy1] action permit
[USG6600-policy-security-rule-policy1] quit
[USG6600-policy-security] quit
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置PAT地址池，开启允许端口地址转换。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[USG6600] nat address-group addressgroup1    
[USG6600-address-group-addressgroup1] mode pat
[USG6600-address-group-addressgroup1] route enable
[USG6600-address-group-addressgroup1] section 0 1.1.1.2 1.1.1.2    //转换的公网IP地址
[USG6600-address-group-addressgroup1] quit
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;配置源PAT策略，实现私网指定网段访问公网时自动进行源地址转换。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[USG6600] nat-policy    
[USG6600-policy-nat] rule name policy_nat1
[USG6600-policy-nat-rule-policy_nat1] source-zone trust
[USG6600-policy-nat-rule-policy_nat1] destination-zone untrust
[USG6600-policy-nat-rule-policy_nat1] source-address 192.168.0.0 mask 255.255.0.0   //允许进行PAT转换的源IP地址
[USG6600-policy-nat-rule-policy_nat1] action nat address-group addressgroup1
[USG6600-policy-nat-rule-policy_nat1] quit
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
