交换机基本配置

display current-configuration      //显示当前配置

display saved-configuration       //保存的配置

auto speed 100           //接口在自协商模式下 速率为100mbps

negotiation auto           //自协商为全双工

display interface 端口   //查看该端口的状态

vlan x

management-vlan   //设置管理vlan

port-group 1        //进入接口组视图

group-member gigabitethernet0/0/1 to gigabitethernet0/0/10     //组成员为1-10接口  方便一次操作多个接口

telnet远程登录

telnet server enable                //启用远程登陆服务

user-interface vty 0 4                //开启VTY线路模式 0-4这5个用户

protocol inbound telnet              //配置VTY支持telnet协议

authentication-mode aaa|password|none   //配置认证方式

aaa               //进入aaa视图

local-user 用户名 password [cipher|simple] 密码   //添加登录用户名密码(明文或密文)

local-user 用户名 privilege level 3                 //设置用户权限 最大为15

return    //回到用户视图

save   //保存

console用户验证方式

user-interface console 0        //进入console控制台接口

authentication-mode aaa|password|none   //验证模式为密码认证

如果是password即

authentication-mode password

则需配置密码

set authentication password [cipher] 密码

端口隔离(同一组实现隔离 不同组不隔离)

port-isolate mode l2|all                   //配置全局端口隔离为二层或三层隔离

interface 端口

port-isolate enable group 1              //端口开启隔离 并加入group1

添加静态MAC地址表项

mac-address static 0001-0002-0003 ethernet 1/0/1 vlan 5   //目的地址为0001-0002-0003,vlan5的报文从接口1/0/1转发出去

display mac-address       //查看MAC地址表

vlan

基于端口划分

undo vlan 3 //撤销vlan

vlan batch 10 to 15  //vlan 10 11 12 13 14 15 批量创建vlan

vlan 3

name huawei        //vlan3 设置名字为huawei 下次进入vlan3可用vlan vlan-name huawei

port link-type hybrid            //混合模式

port hybrid untagged|tagged vlan 5   //带不带标记,并加入vlan5

port default vlan id,  port trunk allow-pass vlan all|id to id  //其他两个模式

interface vlanif 1                 //进入交换机虚接口

ip address 192.168.1.1 24       //设置ip

基于mac地址划分

vlan 3

mac-vlan mac-address 0001-0002-0003                           //MAC地址和vlan3关联

interface ethernet 0/0/1

mac-vlan enable                                                           //在接口下使能MAC地址的划分

gvrp的配置

normal,fixed:禁止动态注册注销vlan,只传播静态vlan信息,forbidden:只传播vlan1的信息。

gvrp                 //全局使能GVRP

各接口设置为trunk 允许所有vlan信息

interface ethernet 0/0/1

gvrp

gvrp registration normal|fixed|forbidden    //注册模式

display gvrp statistics    //查看接口的GVRP统计信息

stp的配置

stp mode stp|rstp         //运行stp或rstp

stp root primary       //交换机指定为根桥

stp root secondary    //交换机指定为备份根桥

stp priority 优先级    //设置网桥的优先级 4096的倍数

stp pathcost-standard legacy    //华为的路径开销算法legacy

Ethernet0/0/1

stp cost 20000  //手动设置端口路径开销 20000为最大,一般把将阻塞的端口设为此

stp edged-port enable   //与PC相连的端口设为边缘端口

stp bpdu-filter enable    //启用bpdu报文过滤

stp enable |disable  //交换机启用或关闭stp功能

路由器配置

dhcp服务器配置

dhcp enable     //全局使能DHCP功能

ip pool pool1   //创建地址池pool1

network 192.168.1.0  mask  255.255.255.0         //范围

gateway-list 192.168.1.254            //网关

dns-list ip1 ip 2              //dns地址

lease day 1 hour 10     //租约信息 1天10小时

static-bind ip-address 192.168.1.1 mac-address 0001-0002-0003 //静态绑定MAC地址和ip

excluded-ip-address 192.168.1.10   //不分配的IP地址

interface ethernet0/0/1

dhcp select global         //使能接口采用全局地址池的DHCP功能

dhcp relay server-ip 12.12.1.1   //dhcp中继代理的设置

静态路由设置

ip route-static  192.168.1.0  24  192.168.10.1

ip route-static  192.168.1.0  255.255.255.0  s0

ip route-static  0.0.0.0  0.0.0.0  10.0.0.1

display ip routing-table   // 查看路由表

ipv6静态路由

进入接口

ipv6 enable

ipv6 address 1::1 64

ipv6 route-static  : :  0  12::2 //下一跳都是转发给12::2(默认路由)

ipv6 route-static  1: :  64  12::1  //静态路由配置

display ipv6 routing-table

动态路由

优先级,直连路由:0,ospf:10,is-is:15,静态路由:60,rip:100,BGP:255

cost为度量值 ,度量值越小越好

rip(30s)   ripv1广播  v2组播224.0.0.9  ripng是ipv6的协议

rip 1

version 2

network 10.0.0.0

undo summary    //取消路由汇聚功能

peer 10.0.0.3    //说明邻接路由器

display rip route  //查看rip协议的路由信息

display rip interface //查看rip接口信息

bfd快速收敛与rip联动

bfd   //全局使能BFD

rip 1  //进入rip视图

bfd all-interfaces enable   //所有接口启动bfd功能

ospf

router id 1.1.1.1   //路由器标识

ospf 1

area 0   //骨干网,area1 区域为0.0.0.1

network 192.168.2.0  0.0.0.255

display ospf routing  //查看ospf路由信息

display ospf peer  //查看邻居信息

ospf cost 开销值  //手动设定开销值

is-is中间系统到中间系统  类似ospf

isis 1

is-level level-1

network-entity net

isis enable

display isis route

display isis peer

路由重发布   (边界路由器)

rip 1      //进入rip视图

import-route  ospf  109  cost  10(不大于15)

ospf 1

import-route  rip 1  cost  200

import-route  static        //静态路由重发布

BGP协议

vrrp

vrrp vrid 1 virtual-ip 192.168.1.254   //虚拟网关ip为192.168.1.254

vrrp vrid 1 priority 120   //优先级

vrrp vrid 1 track interface gi0/0/2 reduced 100(如果gi0/0/2端口的状态变为down,则优先级降低100,变为20)

ACL

acl 编号   //基本acl为2000-2999(仅源time),高级acl为3000-3999,二层acl4000-4999

rule  permit  source  172.168.1.1 0.0.0.0

通配符掩码(反掩码)255.255.255.255表示主机

description  xxx  //只当做描述

[可选]

acl [number] 2000 [match-order:auto|config] //顺序规则config或者自动排序规则auto(深度优先原则)默认config

acl name xx [basic]

基本acl

rule [步长] deny|permit source ip+反掩码|any  time-range time-name

//步长默认为5,再默认以5增长,可自定义步长

//any=0.0.0.0 255.255.255.255

time-range 名称 8:00 to 18:00 working-day

//work-day表示周一到周五  off-day周六周日 daily 每天  0-6 表示每周几 0为星期天

rule deny source 172.16.0.0 0.0.255.255 time-range 名称  //指定时间拒绝

display acl resource

traffic-filter outbound acl name test  //接口直接应用ACl规则

高级acl

rule deny tcp destination-port eq|gt|lt|neg telnet|23 source 192.168.1.0 0 destination 172.16.200.0 0.0.0..255  //禁止源ip192.168.1.0目的ip172.16.200的 tcp端口号等于23 的数据包通过          souce-port

rule permit icmp source xx destination xx  允许ping

Qos策略

traffic classifier c1  operate and|or           //创建流分类

以下面两个流分类为例,对于tc1来说,报文必须同时匹配ACL2001(或ACL3001),802.1p优先级为5和三层协议类型为IP协议三个规则时才属于该类。

[switch] traffic classifier tc1 operator and
[switch-classifier-tc1] if-match acl 2001
[switch-classifier-tc1] if-match 8021p 5
[switch-classifier-tc1] if-match acl 3001
[switch-classifier-tc1] if-match protocol ip

对于tc2来说,报文匹配ACL3001或者报文802.1p优先级为6时都属于该类。

[switch] traffic classifier tc2 operator or
[switch-classifier-tc2] if-match acl 3001
[switch-classifier-tc2] if-match 8021p 6

在一个流行为中可以定义一个或多个动作,如下流行为tb1表示对匹配分类的报文进行流量监管,限速为4096kbit/s,同时进行流量统计。

[switch]traffic behavior tb1                   //创建流行为

[switch-behavior-tb1] car cir 4096    //cir为每秒可通过的速率

[switch-behavior-tb1] statistic enable

流行为tb2表示将匹配分类的报文重定向到下一跳10.10.10.1。

[switch] traffic behavior tb2

[switch-behavior-tb2] redirect ip-nexthop 10.10.10.1

以下面的配置为例,流策略tp1表示对匹配tc1规则的报文执行tb1的动作,对匹配tc2规则的报文执行tb2动作。

[switch] traffic policy tp1 match-order config                     //流策略

[switch-trafficpolicy-tp1] classifier tc1 behavior tb1

[switch-trafficpolicy-tp1] classifier tc2 behavior tb2

应用流策略

流策略配置完之后,需要选择该策略在设备上生效的范围。流策略可以应用在接口、VLAN和全局的出方向和入方向,其中接口包括物理接口、子接口、VLANIF接口和Eth-Trunk接口等。以接口为例,在指定接口入方向应用某个流策略,表示对进入该接口且匹配流分类规则的流量执行指定动作。如下所示:

[switch] interface GigabitEthernet 1/0/1

[switch-GigabitEthernet1/0/1] traffic-policy tp1 inbound

设备上还配置了一个流策略tp2,且应用在VLAN30上

[switch-vlan30] traffic-policy tp2 inbound

二层acl(源地址 目的地址 802.1p优先级 二层协议类型等)

rule deny cos 3  //禁止802.1p优先级为3的报文通过

rule deny destination-mac xx-xx-xx   //mac地址

ipv6-over-ipv4 GRE隧道

interface tunnel0/0/1  //进入隧道口

tunnel-protocol  GRE    //GRE隧道协议

keepalive                     //开启keepalive

ipv6 enable

ipv6 address fc02::1  64        //给隧道口配置ipv6地址

source 10.1.1.1   //源ip地址

destination 10.1.2.2  //目的ip地址

gre key 123   //配置隧道的验证key123

路由器都配置完后,配置路由器的tunnel静态路由

R1::ipv6 route-static  fc03::1  64  tunnel0/0/1

R2:ipv6 route-static  fc01::1  64  tunnel0/0/1

ipv6  ISATAP隧道

interface tunnel0/0/1

tunnel-protocol ipv6-ipv4 isatap  //isatap协议

ipv6 enable

ipv6 address 2001::  64      eui-64    //给隧道口配置ipv6地址

source gigabitethernet2/0/0   //tunnel源地址或源端口

undo ipv6 nd ra halt  //使能系统发布RA报文功能

NAT配置

静态NAT(一对一)

interface seriall0/0/1        //在外网接口下配置

nat static global 202.10.10.1 inside 192.168.1.1  //把公网global地址和inside内网地址绑定

动态NAT(多对多)

interface seriall0/0/1        //在外网接口下配置

nat address-group 1 202.10.1.20  202.10.1.50  //把20-50的地址分为一个组,供内网使用

acl 2000

rule 5 permit source  192.168.1.0  0.0.0.255  //给内网需要Nat转换的地址匹配acl允许

interface  seriall0/0/1        //在外网接口下配置

nat  outbound  2000  address-group  1  no-pat   //使用nat outbound命令将ACL 2000 与地址池相关联,,使得ACL中规定的地址,可以使用地址池,no-pat不可重用

display nat outbound  //在路由器上查看NAT bound信息

NAPT(一对多)pat

nat address-group 0 202.10.1.20 202.10.1.20  //只有一个ip的组

nat outbound 2000 address-group 0   //实现1对多

Easy-IP

nat outbound 2000      //直接使用接口的ip对应内网的ip, 不需要创建地址池,大大节省了地址空间,

display nat session protocol tcp|udp

配置NAT Server

nat server protocol tcp global 202.169.10.6 ftp inside 192.168.1.5 ftp

// nat server命令定义内部服务器的映射表,指定服务器通信协议类型为TCP,,配置服务器使用的公网IP地址为202.169.10.6,服务器内网通信地址为192.168.1.5,指定端口为21,该常用端口号可以直接使用关键字“ftp”代替。

防火墙配置

firewall zone inside  //定义一个区域名字叫inide

priority 15        //定义优先级为15

firewall zone outside  //定义一个区域名字叫outside

priority 5        //定义优先级为5

firewall interzone inside outside    //定义inside区域可以主动访问outside,outside不可主动访问inside ,必须先inside后outside

firewall enable        //开启功能

interface ethernet0/0/1             //进入接口

zone inside       //配置此接口为inside区域

interface ethernet0/0/1             //进入接口

zone inside       //配置此接口为inside区域

display firewall session [protocol  ]  //查看防火墙建立的会话,外网只有会话才能访问内网

如果想让外网能访问内网telnet服务器则

acl 3000

rule permit tcp desitination 192.168.1.100 destitation-port eq telnet //服务器ip192.168.1.100

firewall interzone inside outside

packet-filter 3000 inbound  //包过滤

ipsec

还有个ipsec和BGP协议当时没有写上(考完就忘了),如果有小伙伴有的话可以私聊我加上去,谢谢了

网络工程师 考试命令合集 交换机、路由器、ACL、NAT、防火墙等配置命令相关推荐

  1. 网络工程师人手必备!常用网络命令合集请收下

    [欢迎关注微信公众号:厦门微思网络] 微思网络(官网):https://www.xmws.cn/ 在计算机网络中经常要对网络进行管理,测试,这时就要用到网络命令.今天就为大家整理了一些网络工程师必备的 ...

  2. 2007年下半年软考:网络工程师考试试题分析

    从本次考试的试题及考生对考试的反馈情况来看,2007年下半年(11月)考试的特点是上午试题难度适中,但比上半年的试题难度有所提高.部分试题所提供的选项偏向对概念的考查,选项与选项间很难区分,这要求考生 ...

  3. 网络工程师考试复习心得

    转眼间又到了全国计算机技术与软件专业技术资格(水平)考试的时间,作为一名考取网络工程师资格的通过者,笔者想谈谈自己当时的考试感受以及复习方法,仅供参考. 课本+复习指导资料+CCNA+勤奋=成功 其中 ...

  4. 最新网络工程师考试大纲

    最新网络工程师考试大纲[/b] 一.考试说明 1.考试要求: (1)熟悉计算机系统的基础知识: (2)熟悉网络操作系统的基础知识: (3)理解计算机应用系统的设计和开发方法: (4)熟悉数据通信的基础 ...

  5. 2016年软考网络工程师考试命题范围变化之网络设备配置与复习技巧

    从2016年上半年考试开始,软考网络工程师考试中,对下午部分的网络设备:交换机,路由器和防火墙设备不在局限于cisco的ios和pix设备,增加了华为的部分设备的配置.很多学员就感觉考试难度增加,又要 ...

  6. 技巧心得:网络工程师考试大纲

    今天,我的QQ宠物结婚了~~~ 我应该写写什么东东,纪念下我可爱的宠物. 我看了下,网络工程师考试大纲,里面设计的内容很广,我特地的收集历年的真题和考 试大纲,并附有详细答案,供有缘认识参考学习.至于 ...

  7. 2018 年上半年网络工程师考试上午真题

    2018 年上半年网络工程师考试上午真题 1.CPU:执行算术运算或者逻辑运算时,常将源操作数和结果暂存在( )中. A.程序计数器 (PC) B. 累加器 (AC) C. 指令寄存器 (IR) D. ...

  8. 转发一张网络工程师考试的试卷2021.5.15

    网络工程师考试 单选题 (30题,每题1分,共30分) 1. 你在一个网络中实现DHCP服务,配置一些计算机成为DHCP客户端,由于工作需要,一台系统为Windows 10 的客户端要把从DHCP服务 ...

  9. 2022年下半年网络工程师考试真题下午及答案

    2022年下半年网络工程师考试真题下午及答案 试题一(共20分) 阅读以下说明,回答问题1至问题4,将解答填入答题纸对应的解答栏内. [说明] 某仓储企业网络拓扑结构如图1-1所示,该企业占地500亩 ...

最新文章

  1. Hive SQL 监控系统 - Hive Falcon
  2. openstack-neutron基本的网络类型
  3. linux查看硬件信息
  4. 云炬Android开发笔记 5-9,10拦截器功能设计与实现
  5. python serial_Python代码爬取3000+ 上市公司的信息!能上市的都有这样一个特点
  6. docker 安装部署nacos
  7. 北大暑期课作业 - 对cnblog 和其他技术博客的分析,比较和展望
  8. if __name__ == __main__:什么意思_秒懂Python编程中的if __name__ == 'main' 的作用和原理...
  9. C++:执行i++时,汇编是怎么操作的
  10. PHP MySQL Functions (PDO_MYSQL)
  11. mac通过android打电话,应用短评:用Mac打电话的意义在哪?
  12. 抛物线交点式公式_二次函数顶点式、交点式、两根式概念解读
  13. H.264简单码流分析
  14. java实现 tf-idf
  15. device mapper机制详解
  16. pymol怎么做底物口袋表面_高质量PyMOL作图教程
  17. 风控违约场景如何预测,来看看这份常见的三种模型实现算法对比
  18. windows安装sk-video模块
  19. Python学习基础笔记三十二——正则表达式
  20. 前端PC端微信扫码登录

热门文章

  1. STM32定时器3配置时钟的坑
  2. csr_matrix矩阵压缩
  3. 长春六年级数学辅导班|长春六年级数学补习班
  4. php中框是什么代码,css中box是什么文件
  5. 我们所说的A、B、C、D、E、F、G站你知道吗?
  6. 启用计算机无线网络连接,简单几步解决win7无线网络连接启用不了的问题
  7. CorelDRAW2020工作室版下载及新增功能介绍
  8. 下载Node.js和Node.js软件+Sass结合学习代码
  9. 2.计算机网络是把双刃剑,网络是把双刃剑 安全使用是关键
  10. STM32采用串口DMA方式实现发送数据