路由交换机配置命令笔记

### *交换机基本配置*
    串口com 连接console口   9600 
    配置静态路由 V4 V6
    检查结果
1. 进入命令视图。
   system-view
2. 创建管理VLAN
   vlan5 
   management-vlan
3. 打开TELNET
   telnet server enable
4. 进入VTY线路
   int vty 0 4
5. 配置telnet协议通过
   protocol inbound telnet
6. 配置认证模式
   authentication-mode aaa
7. AAA中配置账户密码
   aaa 
   local-user admin password irrversible-cipher hello@123
8. 设置账号权限最高
   local-user admin privilege level 15 
### 端口配置
- 配置端口双工模式
  duplex (half full auto)
- 工作速率
  speed (10 100 auto )
- 端口流控
  flow-contrul
#### 批量加入
- 批量端口指定VLAN
  vlan 2
  port g 0/0/1 to g0/0/10
- 批量创建VLAN 
  vlan batch 10 20 33 to40
- 创建接口分组
  Port-group 1
  group-number g0/0/1 to g0/0/10 
  port link-type access 
#### 端口镜像配置
- 基于端口镜像
  定义本地观察端口
      observe-port 1 interface gigabitethernet 0/0/10 
  将接口的入方向绑定到索引为1 的观察端口上
      int g0/0/1 
      port-mirroring to observr-port 1 inbound
- 基于流镜像
  定义本地观察端口
      observe-port 1 interface g0/0/10 vlan 10
  定义ACL 匹配TCP 端口号80 
      acl 3000
      rule permit tcp destination-port eq www
  应用流策略 对报文镜像
      int g0/0/1 
      traffic-mirror inbound acl 3000 to observe-port 1

### 端口隔离
- 配置2层隔离
  port-isolate mode  l2
- 把接口加入隔离1组
  int 1/0/1
  port-isolate enable group 1
- 设置接口协商模式为自动 协商速率为100
  negotication auto
  auto speed 100
- 设置自协商模式下双工模式为全双工模式
  negotication auto
### VLAN配置管理
-  VLAN封装协议
  Q INQ 802.1ad 运行商网桥协议
  mac in mac 802.1ah 主干网桥协议
- 交换机命名
  system-view
- 批量方式建立VLAN
  vlan batch 100 200
- 进入接口视图 配置接口类型
  int 1/1/1
  port link-type trunk access hybird
- 将接口接入VLAN2
  port default vlan 2
- 配置上联接口 类型
  port link-type trunk
- 通过VLAN2
  port trunk allow-pass vlan 2
- 基于MAC划分VLAN
  port hybrid untagged vlan 2
- 配置MAC地址与VLAN2关联
  mac-vlan mac-address 22-22-22
- 基于MAC地址启用接口 在哪里,命令
  mac-vlan enable
### 配置GARP
- 全局使能GARP
  garp
- 配置接口为T  允许所有VLAN通过
  port link-tyoe trunk
  port trunk allow-pass vlan all
- 启用接口GARP功能 并配置接口注册模式
  garp 
  garp registration normal
- 查看状态
  display garp statics
### 配置生成树
- 作用
  1. 逻辑断开环路 防止广播风暴
  2. 故障时断开的接口被激活,备份
  3. 形成一个最佳属性拓扑
- 时间
  阻塞--20S--监听--15s--学习--15s--转发
- 配置模式 mode
  stp mode stp
- 配置根桥和备份根桥
  stp root primary    stp instance 1 root primary
  stp root secondary
- 配置开销算法为华为算法
  stp pathcost-standard legacy
- 配置路径开销
  stp cost 2000
- 配置PC连接的端口为边缘端口并启用报文过滤功能
  stp edged-port enable 
  stp bpdu-filter enable  
- 设置根保护
  stp root-protection 
- 设备全局启用
  stp enable
### 路由器配置
- 端口
  高速同步串口
  ISDN BRI
  异步串口
  AUX端口
  E1/T1端口
  路由聚合
      summary
  引入直连路由
      import-route direct 
- 设置系统日期、时间和时区
  clock timezone BJ add 09:00:00
  clock datetime 20:00:00 2013-03-22
- 设置TELNET用户级别和认证方式
  telnet server enable 
  user-interface vty 0 4
  user privilege level 15
  authentication-mode aaa 
  aaa
  local-user admin password irreversible-cipher Hello@123
  local-user admin privilege level 15 
  local-user admin service-type telnet
### 批量配置技术
1. 配置SFTP服务器
   stp server enable 
2. 配置SSH用户界面 认证模式AAA 进入流量 用户级别
   user-interface 0 4
   authentication-mode aaa
   protical inbound all
   user privilege level 15
4. 在AAA中配置SSH用户
    - 账号 
      aaa
      local-user admin password
    - 密码
    - 特权等级
      local-user admin privilege level 15
    - 类型
      local-user admin service-type ssh 
    - 文件
      local-user admin ftp-directory flash:autoconfig
      quit 
      ssh user admin authentication-type password
5. 配置DHCP服务器
    - 创建VLAN10
      vlan 10
    - 在VLAN10中使能DHCP全局模式
      dhcp select global
    - 配置IP池自动配置
      1. 进入自动配置接口
         ip pool auto-config
      2. 配IP掩码
         network ......mask ...
      3. 配网关
         gateway-list....
      4. 文件 用户密码地址等项目
         option 67 文件名
         option 141 用户名
         option 142 密码
         option 143 ip
         option 145  
6. 查看配置结果  
   display startup
### 配置RIP
- 基于 地址
  基于UDP 224.0.0.9  端口号 520 
- 路由收敛
  1. 水平分割
     学习到的,不反方向传回 rip split-borizon
  2. 路由中毒
     不立即删除 度量设置无穷大
  3. 反向度化
     学习到无穷大  返回路由不可达
- 使能
  rip 1
- 版本
  version 2
- 网络
  network 10.10.10.0
- 与BFD联动
  - 全局启用
    bfd 
  - 接口启用
    bfd all-interfaces enable 
  - 配置最小发送、时间间隔、检测时间
    bfd all-interfaces min-rx-interval 100 min-tx-interval 100 detect-multiplier 10
  - 查看会话信息
    display rip 1 bfd session all
  - 查看路由表
   display routing-table
### 配置ISIS
- 创建并进入视图
  isis 1
- 版本
  is-level level-1
- 网络实体名称
  network-entity  10.0000.0000.0001.00
- 接口启用
  isis enable 1
- 查看配置
    1. 是否同步
       display isis isdb
    2. 显示信息
       display isis route
- 思考区域和数据
### 配置OSPF
- 以什么承载
  IP 协议  协议号89 地址224.0.0.5
- 报文时间
  HELLO报文  10秒  40秒不存在
- 配置基本功能
  1. id
     route id 1.1.1.1
  2. 使能
     ospf
  3. 区域
     area 0
 
  4. 查看配置
      display ospf routing
  5.  查看邻居
      display ospf peer 
### 配置BGP
- 报文类型
  open
  update
  notificaton
  keepalive
  route-refresh
- 工作过程
  自身不能发现路由 需要从其他协议引入路由表
      import方式  把其他协议路由表注入
      network方式  逐条精确引入。优先级高
- 哪层,
  TCP 端口号 179
- 配置IBGP连接
    1. 编号
       bgp 65509
    2. ID
       router-id 2.2.2.2 
    3. 对等体
       peer 9.1.3.1 as-number 65009
- 查看对等体连接
  display bgp peer
- 配置R1发布路由 172.16.60.0/24
  ipv4-family unicast  (进入地址簇视图)
  preference 255 100 130 设置优先级 顺序 外部路由优先级 内部路由优先级 本地路由优先级
- 查看路由表信息
  display bgp routing-table
- 配置引入直连路由
  import-route direct
### 配置PPP
- 思考认证协议 两种
  PAP 口令认证协议   CHAP挑战握手协议
1. 创建并配置多链路
   interface mp-group 0/0/1
2. 配置物理接口加入多链路
     - AAA中配置 添加认证所需要的账号密码
       aaa 
       local-user admin password 
     - 账户服务类型
       local-user admin service-type ppp
     - 本地认证模式
       authentication-mode local
     - 进入域中 设置认证方案
       domian system
       authentication-scheme system_a
     - 进入接口
       interface serial 1/0/0
     - 配置PPP认证模式 、用户、密码 和加入组
       ppp authentication-mode chap domain system 
       ppp chap user admin
       ppp chap password cipher ad@123
       ppp mp mp-group 0/0/1
     - 重启接口
       restart
     - 查看结果
       display ppp mp interface Mp-group 0/1/1
     - 查看绑定结果
       display interface Mp-group
### 配置帧中继
- 进入接口
  interface serial 1/0/0
- 配置封装为帧中继
  link-protocol fr
- 设置接口类型(哪种设备)
  fr interface-type dte
- 配置静态地址映射
    1. 虚电路号
       fr dlci 70
       quit
    2. 配置IP
       ip addredd 10.10.10.9 30
    3. 配置对端
       fr map ip 10.10.10.10 70
### 配置ISDN
1. 配置拨号控制列表
   - dialer-rule
   - dialer-rule 1 ip permit
2. 配置帧中继地址映射
   - int dialer 0
   - link-protocol fr
   - ip address 10.10.10.9 30
   - fr dlci 70
   - quit 
   - fr map ip 10.10.10.10 70
3. 配置控制列表关联接口
   - dialer-group 1
4. 使能轮询DCC
   dialer enable-circular
5. 发起呼叫
   dialer number 800011
6. 配置物理接口并加入拨号循环组
   int bri 1/0/0
   link-protocol fr 
   dialer circular-group 0
7. 查看配置
   display insd call-info
### 配置IPSEC
- 多条数据流需保护的情况下
  IP address-set sou1 type object  -- 添加成组--
  rule permit ip source address-set sou1
- 配置保护数据流
  acl 3001
  rule permit ip source 10.10.10.0 0.0.0.255 destination 10****
- 配置IPSEC安全提议
  ipsec proposal tran1
  esp authentication-algorithm sha2-256
  esp encryption-algorithm aes-128
- IKE安全提议
  ike proposal 5
  encryption-algorithm aes-128
  authentication-algorithm sha2-256
  dh group14
- 配置IKE对等体 配置预共享密钥和对端ID
  ike peer spub
  undo version 2
  ike proposal 5
  pre-shared-key cipher huawei
  remote-address 167.1.1.1
- 创建安全策略
  - 配置IKE动态协商方式安全策略
      ipsec policy map1 10 isakmp
      ike-peer spub
      proposal tran1
      security acl 3001   quit
- 在接口应用安全策略组
  - int g1/0/0
  - ipsec policy map1
- 查看配置结果
### ipv6
- 两种策略
  1. 双栈策略
  2. 隧道策略
     - ipv6 over ipv4 gre隧道配置
       在IPV4中封装IPV6
       interface tunnel 接口
       tunnel-protocal gre
       ipv6 enable 
       ipv6 address fc02::1 64
       source 10.1.1.1
       destination 10.1.2.2
     - ISATAP隧道配置  (站内自动隧道寻址协议)
         点到点   IPV4在IPV6里   
         地址形式 0:5efe:ipv4add
         - 配置
             1.  创建隧道
                interface tunnel 1/0/0
             2. 修改隧道协议为ISATAP
                tunnel-protocol ipv6-ipv4 isatap
             3. 配置接口全球单播地址 EUI64
                ipv6 address 2001::/64 
             4. 配置TUNNEL源地址或源接口
                source g2/0/2
             5. 使能系统发布RA报文功能
                undo ipv6 nd ra halt (nd Neighbor Discovery邻居发现 ra 通告 halt 禁止)    
             6. 主机配置用户端添加静态路由
                netsh interface ipv6 isatap set router 2.1.1.1
      - 查看配置结果
        display ipv6 interface tunnel 0/0/2
### 访问控制列表
- 两种模式
  1. config模式
  2. auto模式
     - acl number 3001 match-order auto 
     - 深度优先
- 删除ACL
  undo acl
- 调整步长
  step 
- 查看和清除信息
  reset acl counter 
  display acl resource
- 配置基于时间ACL规则
  time-range working-time 8:00 to 18:00 working-day
  acl name work-acl basic
  rule deny source 172.16.10.0 0.0.0.255 time-range working-time
- 描述信息
- 配置禁止172.16.10.3 访问WEB网页 端口号是80
  rule deny tcp destination-port eq 80 source 172.16.10.3
#### 综合配置ACL
-  配置接口加入VLAN
  port link-type trunk
  port trunk allow-pass vlan 10
- 配置时间段 (8点到晚6点,工作时间)
  time-range satime 08:00 to 18:00 working-day
- 配置ACL规则
  acl 3001 rule deny ip source 192......destination 192.168.10.10 0.0.0.255 time-range satime
- 配置流分类
  traffic classifier xxx
  if-match acl 3001
- 流行为
  fraffic behavior aaaa
  deny
  配置重定向
     redirect ip-nexthop 100.120.111.10
- 流策略
  traffic policy p_xs
  classifier xxx behavior b_xs
- 在接口应用
  interface ethernet2/0/1
  traffic policy p_xs  inbound 
- 查看配置结果
  display acl all 
### 配置链路聚合
-  华为协议 
  - 协议名
    lacp 基于802.3 ad 
  - 两种模式
    手工  和 协议 lacp
  - 创建并进入聚合组
    interface Eth-Trunk 1
  - 将接口加入组
        1. trunkport e1/0/1 to 1/0/3
        2. int e1/0/1
           Eth-Trunk1
  - 允许VLAN
  - LACP模式
    mode lacp-static
  - 优先级
  - 手工模式
    mode manual load-balance 
  - 最少最大激活链路数量
     least active-linknumber
     max active-linknumber
  - 负载分担方式
    load-balance 
  - 优先级
    lacp priority
### VRRP协议
- 心跳线,相互监视对方状态,虚拟路由冗余协议
-  作用
  路由备份,负载分担,主备切换 解决静态网关出现单点故障
  组播地址 224.0.0.18  封装在IP里
- 配置
  vrrp vrid 1 virtual-ip 192.168.1.254
  vrrp vrid1 priority 128
### 配置BFD
- 作用
  快速检测、监控网络故障  提高可靠性  hello报文 
- 组播地址
  224.0.0.184
- 配置
  bfd 会话名 bind peer-ip 地址(VPN名) interface 接口
  本地标识符
      discriminator local xxx
  远端标识符
      discriminator remote xx 
### 防火墙配置
- 三种技术
  包过滤防火墙
      通过ACL 检查源目地址、协议
  代理服务器式防火墙
      对4-7层数据检查  更高开销 工作变慢
  基于状态检测的防火墙
      检测每个TCP、UDT类的会话连接 
      工作于基于数据包、连接会话和一个基于状态的会话流表  
      性能比前两个高
- 区域结构
  trust untrust DMZ  local 
- 方向
  进方向 inbound 优先级低到高
  出方向  outbound 优先级从高到低 
- 配置
  1. 创建并进入安全区域视图
      firewall zone [name] zone-name
  2. 创建安全区域优先级
      set priority security-priority   创建安全区域优先级
  3. 将接口加入安全区域
      add ingerface interface-type interface-number 将接口加入安全区域
  4. 创建域间安全策略
       security-policy
       rule name policy 1
       source zone trust 
       source-address 10.1.3.0 mask 24
       destination-address 10.1.1.0 mask 24
       action permit
  5. 进入安全域间视图 
      interzone zone-name1 zone-name2
    -  dmz区域配置
      firewall interzone dmz untrust
      detect ftp  配置域间NTY ALG功能,使服务器可以对外正常提供FTP
  6. 配置内部地址映射到外网地址
      net server policyweb protocol tcp global 10.1.1.100 80 inside 10.1.1.2 80 no-reverse
      net server policyftp protocol tcp global 10.1.1.100 21 inside 10.1.1.3 21 no-reverse

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值