eNSP命令总结
关于发包流程
【发包流程】
发数据 –> 查路由表(找方向)
–> 查 ARP 表(找下一跳的 MAC) dis arp
–> 查 MAC 表(找出哪个接口) dis mac-add
–> 查转发表(实际把包送出去)dis ip forwarding
基本路由配置与查看
1 | ip route 目的ip 子网掩码 下一跳ip #静态路由配置 |
ospf相关命令
1 | dis ospf peer #查看ospf邻居信息 |
1 | ospf 进程id router-id [router-id]#创建并运行进程id |
可选:
1.配置ospf接口开销
1 | ospf cost 【cost】 |
2.设置ospf带宽参考值
1 | bandwidth-reference 【vlaue】 |
3.设置接口在选举DR时的优先级
1 | ospf dr-priority 【priority】 |
VLAN的基本配置
1 | vlan batch vlan-id vlan-id2 #批量创建vlan |
示例:
1 | vlan batch 10 20 #创建两个不连续vlan |
Access接口的基本配置
1 | port link-type access #配置接口类型为access接口 |
Trunk接口的基本配置
1 | port link-type trunk #配置接口类型为Trunk接口 |
1 | undo info-center enable #删除日志命令 |
1 | dis port vlan #查看vlan信息 |
VLAN间通信
实现VLAN基本配置后
1.进入vlanif接口
1 | int vlanif 10 对应vlan-id |
2.配置接口ip
1 | ip add 网络地址 掩码 |
每个接口都需要完成配置
生成树的基本配置
目的:防环 步骤 配置stp基本信息 ,设置根桥,设置主根桥和备根桥
首先完成vlan的基本配置
1.进入生成树根配置
1 | stp region-configuration |
2.配置根名,可随便取
1 | region-name 【根名】 |
3.将vlan加入实例
1 | instance 【实例号】 vlan 【vlan-id】 |
4.手动启用配置
1 | active region-configuration |
5.复制到所有路由器保持配置实例信息一致
6.找到主根桥,配置为主根桥
1 | stp instance 【实例号】 root primary |
7.找到备根桥,配置为备根桥
1 | stp instance 【实例号】 root secondary |
VRRP基本配置
进入vlanif接口配置
1.创建VRRP备份组并给备份组配置虚拟IP地址
1 | vrrp vrid 【vid】 virtual-ip 【v-add】 |
2.配置在备份组中的优先级 优先级高的作为Master设备
1 | vrrp vrid 【vid】 priority 【priority-vlaue】 |
3.配置track技术 上行接口,当接口故障,自动降优先级让备路由顶替
1 | vrrp vrid 【vid】 track interface 【上行接口】redueced 【降级数值】 |
查看配置信息:dis vrrp brief
ACL基本配置
基本ACL
1.创建基本ACL (acl 2000-2999)
数字型:
1 | acl [number] acl-number [match-order config] |
命名型:
1 | acl name [acl-name] {basic acl-number} [match-order config] |
1 | rule (rule id)deny/permit source 【source-add】 |
示例:
1 | [Router] acl 2000 |
高级ACL
1.创建高级ACL
1 | acl [ number ] acl-number [ match-order config ] |
2.配置基本ACL的规则
当参数protocol为IP时,高级ACL的命令格式为
1 | rule [ rule-id ] { deny | permit } ip [ destination { destination-address destination-wildcard | any } | source { source-address source-wildcard | any } | time-range time-name | [ dscp dscp | [ tos tos | precedence |
当参数protocol为TCP时,高级ACL的命令格式为
1 | rule [ rule-id ] { deny | permit } { protocol-number | tcp } [ destination { destination-address destination-wildcard | any } | destination-port { eq port | gt port | lt port | range port-start port-end } | source { source-address source-wildcard | any } | source-port { eq port | gt port | lt port | range port-start port-end } | tcp-flag { ack | fin | syn } * | time-range time-name ] * |
示例
1 | [Router] acl 3001 |
应用acl到接口生效
1 | interface GigabitEthernet 0/0/1 #进入接口 |
DHCP基本配置
1 | int vlan [vlanid] |
NAT基本配置
nat server的配置
1 | nat server httpserver protocol tcp global 100.1.123.254 80 insid |
源NAT
1 | nat address-group nat名 |
1 | display nat session verbose # 查看包含端口转换的会话信息 |
防火墙基本配置
1 | dis firewall session table verbose #查看会话表 |
1.创建安全区域
1 | firewall zone zone-name |
2.将接口添加到防火墙
1 | add int 接口 |
3.给防火墙接口配置ip
1 | int 接口 |
此时不同区域是无法连通的
有一个简单快速让主机可以ping通防火墙
1.进入安全策略视图
1 | security-policy |
2.命名
1 | rule name |
3.配置策略
1 | source-zone 源安全区域 |
ip-link 探测机的连通性探测基本配置
1.开启ip-link
1 | ip-link check enable |
2.命名
1 | ip-link name 【name】 |
3.指定探测位置
1 | destination 目的ip int 出接口 mode icmp |