当前位置:首页 » 存储配置 » 锐捷自定义访问列表如何配置

锐捷自定义访问列表如何配置

发布时间: 2022-07-16 20:58:21

① 关于锐捷交换机配置

1、将USB转串口网口数据线一头插入交换机前面板的“consel”口。



注意事项:

四个网段也就是四个vlan的网关全部落在一台核心交换机上,就可以实现互通了,因为vlanif的地址在交换机里天生互通,然后核心交换机再以三层路由的方式到路由器出外网。最后的一台计算机或者设备可以通过外网访问

② 锐捷交换机如何配置

交换机基本操作
1.进入特权模式
Switch>enable
Switch#
2.返回用户模式
Switch#exit
Press
RETURN
to
get
started!
Switch>
配置模式:
全局配置模式[主机名(config)#]:配置交换机的整体参数
子模式:
1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数
2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数
1.进入全局配置模式下
Switch#configure
terminal
Switch(config)#exit
Switch#
2.进入线路配置模式
Switch(config)#line
console
0
Switch(config-line)#exit
Switch(config)#
3.进入接口配置模式
Switch(config)#interface
fastEthernet
0/1
Switch(config-if)#exit
Switch(config)#
从子模式下直接返回特权模式
Switch(config-if)#end
Switch#
交换机操作帮助特点:
1.支持命令简写(按TAB键将命令补充完整)
2.在每种操作模式下直接输入“?”显示该模式下所有的命令
3.命令空格
“?”显示命令参数并对其解释说明
4.字符“?”显示以该字符开头的命令
5.命令历史缓存:
(Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令
6.错误提示信息
交换机显示命令:
显示交换机硬件及软件的信息
Switch#show
version
显示当前运行的配置参数
Switch#show
running-config
显示保存的配置参数
Switch#show
configure
常用交换机EXEC命令
将当前运行的配置参数复制到flash:Switch#write
memory
Building
configuration...
[OK]
Switch#
清空flash中的配置参数:Switch#delete
flash:config.text
Switch#
交换机重新启动:Switch#reload
System
configuration
has
been
modified.
Save?
[yes/no]:n
Proceed
with
reload?
[confirm]
配置交换机主机名:Switch(config)#hostname
S2126G
S2126G(config)#
配置交换机口令:
1、
配置交换机的登陆密码
S2126G(config)#enable
secret
level
1
0
star
“0”表示输入的是明文形式的口令
2、
配置交换机的特权密码
S2126G(config)#enable
secret
level
15
0
Star
“0”表示输入的是明文形式的口令
常用交换机配置命令:
1、为交换机分配管理IP地址
S2126G(config)#interface
vlan
1
S2126G(config-if)#ip
address
{IP
address}
{IP
subnetmask}[secondary]
2、将接口启用
S2126G(config-if)#no
shutdown
3、将接口关闭
S2126G(config-if)#shutdown
4、配置接口速率
S2126G(config-if)#speed
[10|100|auto]
5、配置接口双工模式
S2126G(config-if)#plex
[auto|full|half
显示接口状态:S2126G#show
interfaces
测定目的端的可达性:S2126G>ping
{IP
address}
从Tftp服务器下载配置参数:S2126G#
tftp
startup-config
管理交换机MAC地址表:
1、查看MAC地址表
S2126G#show
mac-address-table
2、配置MAC地址表记录的生存时间(缺省为300秒)
S2126G(config)#mac-address-table
aging-time
<10-1000000>
3、查看MAC地址表记录的生存时间
S2126G#show
mac-address-table
aging-time
VLAN的配置:
1.添加一个VLAN
S2126G(config)#vlan
<1-4094>
S2126G(config-vlan)#
2.为VLAN命名(可选)
S2126G(config-vlan)#name
将交换机端口分配到VLAN
1.配置Port
VLAN
Switch(config-if)#switchport
access
vlan
<1-4094>
2.配置Tag
VLAN
Switch(config-if)#switchport
mode
trunk
1).配置本地(native)VLAN
Switch(config-if)#switchport
trunk
native
vlan
<1-4094>
2).从主干链路中清除VLAN
Switch(config-if)#switchport
trunk
allowed
vlan
except
注:VLAN1不可被清除
VLAN的验证:
1.显示全部的VLAN:Switch#show
vlan
2.显示单独的VLAN
:Switch#show
vlan
id
<1-4094>
将VLAN信息保存到flash中:Switch#write
memory
从flash中清除VLAN信息:Switch#delete
flash:vlan.dat
RSTP的配置:
1.启用生成树:S2126G(config)#spanning-tree
2.配置交换机优先级:S2126G(config)#spanning-tree
priority
<0-61440>
“0”或“4096”的倍数(RSTP
BPDU该值后12bit全0)
3.配置交换机端口优先级:S2126G(config-if)#spanning-tree
port-priority
<0-240>
“0”或“16”的倍数(RSTP
BPDU该值后4bit全0)
4、生成树hello时间的配置(由Root决定):S2126G(config)#spanning-tree
hello-time
<1-10>
5、生成树的验证:Switch#show
spanning-tree
Switch#show
spanning-tree
interface
<接口名称>
<接口编号>
以上用于锐捷交换机的。交换机配置命令集>Enable
进入特权模式
#ExIT
返回上一级操作模式
#End
返回到特权模式
#write
memory

running-config
startup-config
保存配置文件
#del
flash:config.text
删除配置文件(交换机及1700系列路由器)
#erase
startup-config
删除配置文件(2500系列路由器)
#del
flash:vlan.dat
删除Vlan配置信息(交换机)
#Configure
terminal
进入全局配置模式
(config)#
hostname
switchA
配置设备名称为switchA
(config)#banner
motd
&
配置每日提示信息
&为终止符
(config)#enable
secret
level
1
0
star
配置远程登陆密码为star
(config)#enable
secret
level
15
0
star
配置特权密码为star
Level
1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密
(config)#enable
services
web-server
开启交换机WEB管理功能
Services
可选以下:web-server(WEB管理)、telnet-server(远程登陆)等查看信息
#show
running-config
查看当前生效的配置信息
#show
interface
fastethernet
0/3
查看F0/3端口信息
#show
interface
serial
1/2
查看S1/2端口信息
#show
interface
查看所有端口信息
#show
ip
interface
brief
以简洁方式汇总查看所有端口信息
#show
ip
interface
查看所有端口信息
#show
version
查看版本信息
#show
mac-address-table
查看交换机当前MAC地址表信息
#show
running-config
查看当前生效的配置信息
#show
vlan
查看所有VLAN信息
#show
vlan
id
10
查看某一VLAN
(如VLAN10)的信息
#show
interface
fastethernet
0/1
switchport
查看某一端口模式(如F
0/1)
#show
aggregateport
1
summary
查看聚合端口AG1的信息
#show
spanning-tree
查看生成树配置信息
#show
spanning-tree
interface
fastethernet
0/1
查看该端口的生成树状态
#show
port-security
查看交换机的端口安全配置信息
#show
port-security
address
查看地址安全绑定配置信息
#show
ip
access-lists
listname
查看名为listname的列表的配置信息
#show
access-lists端口的基本配置
(config)#Interface
fastethernet
0/3
进入F0/3的端口配置模式
(config)#interface
range
fa
0/1-2,0/5,0/7-9
进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式
(config-if)#speed
10
配置端口速率为10M,可选10,100,auto
(config-if)#plex
full
配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)
(config-if)#no
shutdown
开启该端口
(config-if)#switchport
access
vlan
10
将该端口划入VLAN10中,用于VLAN
(config-if)#switchport
mode
trunk
将该端口设为trunk模式,用于Tag
vlan
可选模式为access
,
trunk
(config-if)#port-group
1
将该端口划入聚合端口AG1中,用于聚合端口聚合端口的创建
(config)#
interface
aggregateport
1
创建聚合接口AG1
(config-if)#
switchport
mode
trunk
配置并保证AG1为
trunk
模式
(config)#int
f0/23-24
(config-if-range)#port-group
1
将端口(端口组)划入聚合端口AG1中生成树
(config)#spanning-tree
开启生成树协议
(config)#spanning-tree
mode
stp
指定生成树类型为stp
可选模式stp
,
rstp
,
mstp
(config)#spanning-tree
priority
4096
设置交换机的优先级为4096
,
优先级值小为高。优先级可选值为0,4096,8192,……,为4096的倍数。交换机默认值为32768VLAN的基本配置
(config)#vlan
10
创建VLAN10
(config-vlan)#name
vlanname
命名VLAN为vlanname
(config-if)#switchport
access
vlan
10
将该端口划入VLAN10中
某端口的接口配置模式下进行
(config)#interface
vlan
10
进入VLAN
10的虚拟端口配置模式
(config-if)#
ip
address
192.168.1.1
255.255.255.0
为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录的IP地址
(config-if)#
no
shutdown
启用该端口端口安全
(config)#
interface
fastethernet
0/1
进入一个端口
(config-if)#
switchport
port-security
开启该端口的安全功能
1.配置最大连接数限制
(config-if)#
switchport
port-secruity
maxmum
1
配置端口的最大连接数为1,最大连接数为128
(config-if)#
switchport
port-secruity
violation
shutdown
配置安全违例的处理方式为shutdown,可选为protect
(当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable
recovery来恢复)
2.IP和MAC地址绑定
(config-if)#switchport
port-security
mac-address
xxxx.xxxx.xxxx
ip-address
172.16.1.1
接口配置模式下配置MAC地址xxxx.xxxx.xxxx和IP172.16.1.1进行绑定(MAC地址注意用小写)三层路由功能(针对三层交换机)
(config)#
ip
routing
开启三层交换机的路由功能
(config)#
interface
fastethernet
0/1
(config-if)#
no
switchport
开启端口的三层路由功能(这样就可以为某一端口配置IP)
(config-if)#
ip
address
192.168.1.1
255.255.255.0
(config-if)#
no
shutdown
三层交换机路由协议
(config)#
ip
route
172.16.1.0
255.255.255.0
172.16.2.1
配置静态路由
注:172.16.1.0
255.255.255.0
为目标网络的网络号及子网掩码
172.16.2.1
为下一跳的地址,也可用接口表示,如ip
route
172.16.1.0
255.255.255.0
serial
1/2(172.16.2.0所接的端口)
(config)#
router
rip
开启RIP协议进程
(config-router)#
network
172.16.1.0
申明本设备的直连网段信息
(config-router)#
version
2
开启RIP
V2,可选为version
1(RIPV1)、version
2(RIPV2)
(config-router)#
no
auto-summary
关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)#
router
ospf
开启OSPF路由协议进程(针对1762,无需使用进程ID)
(config)#
router
ospf
1
开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)
(config-router)#
network
192.168.1.0
0.0.0.255
area
0
申明直连网段信息,并分配区域号(area0为骨干区域)IP
ACL:
交换机采用命名的访问控制列表;分标准(stand)和扩展(extended)两种
1.标准ACL
(config)#ip
access-list
stand
listname
定义命名标准列表,命名为listname,stand为标准列表
(config-std-nacl)#deny
192.168.30.0
0.0.0.255
拒绝来自192.168.30.0网段的IP流量通过
注:deny:拒绝通过;可选:deny(拒绝通过)、permit(允许通过)
192.168.30.0
0.0.0.255:源地址及源地址通配符;可使用any表示任何IP
(config-std-nacl)#permit
any
(config-std-nacl)#end
返回
2.扩展ACL
(config)#ip
access-list
extended
listname
定义命名扩展列表,命名为listname,extended为扩展
(config-ext-nacl)#deny
tcp
192.168.30.0
0.0.0.255
192.168.10.0
0.0.0.255
eq
www
拒绝源地址为192.168.30.0网段的IP访问目的地址为192.168.10.0网段的WWW服务
注:deny:拒绝通过,可选:deny(拒绝通过)、permit(允许通过)
tcp:
协议名称,协议可以是udp,
ip,eigrp,
gre,
icmp,
igmp,
igrp等等。
192.168.10.0
0.0.0.255:源地址及源地址通配符
192.168.30.0
0.0.0.255:目的地址及目的地址通配符
eq:操作符(lt-小于,eq-等于,gt-大于,neg-不等于,range-包含)
www:端口号,可使用名称或具体编号
可以使用的协议名称(或编号)和端口名称(或编号)请打?查询。
(config-ext-nacl)#permit
ip
any
any
允许其它通过
(config-ext-nacl)#end
返回
(config)#interface
vlan
10
进入端口配置模式
(config-if)#
ip
access-group
listname
in
访问控制列表在端口下in方向应用;可选:in(入栈)、out(出栈)
(config-if)#end
返回
注:配置ACL时,若只想对其中部分IP进行限制访问时,必须配置允许其流量通过,否则设备只会对限制IP进行处理,不会对非限制IP进行允许通过处理。

③ 锐捷MSTP配置

交换机
密码
1234(config)#enable secret level 1 0 100
1234(config)#enable secret level 15 0 100
远程登入密码
1234(config)#line vty 0 4
1234(config-line)#password 100
1234(config-line)#end
交换机管理IP
1234(config)#interface vlan 1
1234(config-if)#ip address 192.168.1.10 255.255.255.0
1234(config-if)#no shutdown
修改交换机老化时间
1234(config)#mac-address-table aging-time 20
1234(config)#end
添删vlan
1234(config)#vlan 888
1234(config-vlan)#name a888
1234(config)#no vlan 888
添加access口
1234(config)#interface gigabitEthernet 0/10
1234(config-if)#switchport mode access
1234(config-if)#switchport access vlan 10
切换assess trunk
1234(config-if)#switchport mode access
1234(config-if)#switchport mode trunk
指定特定一个native vlan
1234(config-if)#switchport trunk native vlan 10
配置trunk口的许可vlan列表
1234(config-if)#switchport trunk allowed vlan ?
add Add VLANs to the current list
all All VLANs
except All VLANs except the following
remove Remove VLANs from the current list
速成树协议
1234(config)#spanning-tree
1234(config)#spanning-tree mode rstp/stp
配置网关:
switch(config)#ip default-gateway 192.168.1.254
交换机基本配置-常见查看命令
查看CPU利用率
show cpu
查看交换机时钟
show clock
查看交换机日志
show logging
查看交换机动态学习到的MAC地址表
show mac-address-table dynamic
查看当前交换机运行的配置文件
show running-config
查看交换机硬件、软件信息
show version
查看交换机的arp表
show arp
显示接口详细信息的命令
show interfaces gigabitEthernet 4/1 counters
接口配置
Switch(config)#interface gigabitethernet 0/1
把接口工作模式改为光口。
Switch(config-if)#medium-type fiber
把接口工作模式改为电口。
Switch(config-if)#medium-type copper
速度/双工配置
进入接口配置模式。
Switch(config)#interface interface-id
设置接口的速率参数,或者设置为auto。
Switch(config-if)#speed {10 | 100 | 1000 | auto }
设置接口的双工模式。
Switch(config-if)#plex {auto | full | half}
例子
Switch(config)#interface gigabitethernet 0/1
Switch(config-if)#speed 1000
Switch(config-if)#plex full
光口不能修改速度和双工配置,只能auto。
在故障处理的时候,如果遇到规律性的时断时续或掉包,在排除其他原因后,可以考虑是否和对端设备的速率和双工模式不匹配,尤其是两端设备为不同厂商的时候。
VLAN
建立VLAN 100
Switch (config)#vlan 100
该VLAN名称为ruijie
Switch (config)#name ruijie
将交换机接口划入VLAN 中:
range表示选取了系列端口1-48,这个对多个端口进行相同配置时非常有用。
Switch (config)#interface range f 0/1-48
将接口划到VLAN 100中。
Switch (config-if-range)#switchport access vlan 100
将接口划回到默认VLAN 1中,即端口初始配置。
Switch (config-if-range)#no switchport access vlan
Switch(config)#interface fastEthernet 0/1
该端口工作在access模式下
Switch(config-if)#switchport mode access
该端口工作在trunk模式下
Switch(config-if)#switchport mode trunk
Switch(config)#interface fastEthernet 0/2
设定VLAN要修剪的VLAN。
Switch(config-if)#switchport trunk allowed vlan remove 2-9,11-19,21-4094
取消端口下的VLAN修剪。
Switch(config-if)#no switchport trunk allowed vlan
生成树
开启生成树协议。
Switch(config)#spanning-tree
禁止生成树协议。
Switch(config)#no spanning-tree
配置生成树优先级:
配置设备优先级为4096。
Switch(config)#spanning-tree priority 4096
数值越低,优先级别越高。
端口镜像
配置G0/2为镜像端口。
Switch (config)# monitor session 1 destination interface G 0/2
配置G0/1为被镜像端口,且出入双向数据均被镜像。
Switch (config)# monitor session 1 source interface G 0/1 both
去掉镜像1。
Switch (config)# no monitor session 1
端口聚合
Switch(config)#interface fastEthernet 0/1
把端口f0/1加入到聚合组1中。
Switch (config-if)#port-group 1
把端口f0/1从聚合组1中去掉
Switch (config-if)#no port-group 1
建立ACL:
建立ACL访问控制列表名为ruijie,extend表示建立的是扩展访
Switch(config)# Ip access-list exten ruijie
问控制列表。
添加ACL的规则:
禁止PING IP地址为192.168.1.1的设备。
Switch (config-ext-nacl)#deny icmp any 192.168.1.1 255.255.255.0
禁止端口号为135的应用。
Switch (config-ext-nacl)# deny tcp any any eq 135
禁止协议为www的应用。
Switch (config-ext-nacl)#deny udp any any eq www
允许所有行为。
Switch(config-ext-nacl)# permit ip any any
将ACL应用到具体的接口上:
Switch (config)#interface range f 0/1
把名为ruijie的ACL应用到端口f 0/1上。
Switch (config-if)#ip access-group ruijie in
从接口去除ACL。
Switch (config-if)#no ip access-group ruijie in
删除ACL:
删除名为ruijie的ACL。
Switch(config)#no Ip access-list exten ruijie
增加ACE项后,是增加到ACL最后,不可以中间插入,如果要调整ACE的顺序,必须整个删除ACL后再重新配置。
端口安全
Switch (config)#interface range f 0/1
开启端口安全。
Switch(config-if)# switchport port-security
关闭端口安全。
Switch(config-if)# no switchport port-security
设置端口能包含的最大安全地址数为8。
Switch(config-if)# switchport port-security maximum 8
在接口fastethernet0/1配置一个安全地址00d0.f800.073c,并为其绑定一个IP地址192.168.1.1
Switch(config-if)# switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1
删除接口上配置的安全地址。
Switch(config-if)#no switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1
防ARP攻击
IP和MAC地址的绑定
Switch(config)#arp ip-address hardware-address [type] interface-id
Switch(config)#arp 192.168.12.111 00d0.f800.073c arpa g 0/1
绑定网关
进入指定端口进行配置。
Switch(config)#Interface interface-id
配置防止ip-address的ARP欺骗。
Switch(config-if)#Anti-ARP-Spoofing ip ip-address
防STP攻击
进入端口Fa0/1。
Switch(config)# inter fastEthernet 0/1
打开该端口的的BPDU guard功能。
Switch(config-if)# spanning-tree bpguard enable
关闭该端口的的BPDU guard功能。
Switch(config-if)# spanning-tree bpguard diaable
端口关闭后只能shutdown然后再no shutdown
或者重新启动交换机才能恢复!
防DOS/DDOS攻击
进入端口Fa0/1。
Switch(config)# inter fastEthernet 0/1
预防伪造源IP的DOS攻击的入口过滤功能。
Switch(config-if)#ip deny spoofing-source
关闭入口过滤功能只能在三层接口上配置。
Switch(config-if)#no ip deny spoofing-source
和ACL不能同时存在。
端口关闭后只能shutdown然后再no shutdown
或者重新启动交换机才能恢复!
防IP扫描攻击配置:
打开系统保护。
Switch(config)#system-guard enable
关闭系统保护功能。
Switch(config)#no system-guard
DHCP配置
打开DHCP Relay Agent:
Switch(config)#service dhcp
配置DHCP Server的IP地址:
Switch(config)#ip helper-address address
VRRP配置
Switch(config)#Interface interface-id
Switch(config-if)#Standby [group-number] ip ip-address
设置虚拟机的优先级。
standby [group-number] priority priority
三层交换机配置
SVI:
把VLAN 10配置成SVI。
switch (config)#interface vlan 10
给该SVI接口配置一个IP地址
switch (config-if)#ip address 192.168.1.1 255.255.255.0
Routed Port:
switch (config)#interface fa 0/1
把f 0/1变成路由口。
switch (config-if)#no switch
路由配置:
添加一条路由。
switch (config)#ip route 目的地址 掩码 下一跳
switch (config)#ip route 210.10.10.0 255.255.255.0 218.8.8.8

④ 路由器的访问控制列表是怎样设置的

在路由上建若干个访问控制列表(ACL),然后配置好后把它们应用到相应端口,就能实现你的要求。
扩展型的ACL可以实现限制某些IP地址的某些服务或端口的拦截,比如电子邮件,FTP之类都是可以限制的,只能访问某一站点也是可以实现的,只允许它们访问限定的IP就行了。
具体的就是TELNET到你路由的接口,然后打命令去。具体命令想解释清楚就太长了。。。也不知道你什么情况没法细说。
限制改IP也很容易实现,如果你用的WINDOWS的话,只要设置权限就行了。具体的到“本地安全策略”里设,点
开始-运行-输入“gpedit.msc”
在“本地策略”的“用户权利指派”里有各用户组的权利分配。如果对用户组做调整,用“组策略”-开始-运行-“gpedit.msc”
可以把用户划分到不同的组以分配权限。

⑤ 网络搭建初学者。求锐捷三层、二层交换机配置命令。锐捷路由器配置命令。尽量全一些。路由器的重启方法。

锐捷网络交换机的配置命令集

交换机

>Enable 进入特权模式
#Exit 返回上一级操作模式
#End 返回到特权模式
#write memory 或 running-config startup-config 保存配置文件
#del flash:config.text 删除配置文件(交换机及1700系列路由器)
#erase startup-config 删除配置文件(2500系列路由器)
#del flash:vlan.dat 删除Vlan配置信息(交换机)
#Configure terminal 进入全局配置模式
(config)# hostname switchA 配置设备名称为switchA
(config)#banner motd & 配置每日提示信息 &为终止符
(config)#enable secret level 1 0 star 配置远程登陆密码为star
(config)#enable secret level 15 0 star 配置特权密码为star
Level 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密
(config)#enable services web-server 开启交换机WEB管理功能
Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等

查看信息
#show running-config 查看当前生效的配置信息
#show interface fastethernet 0/3 查看F0/3端口信息
#show interface serial 1/2 查看S1/2端口信息
#show interface 查看所有端口信息
#show ip interface brief 以简洁方式汇总查看所有端口信息
#show ip interface 查看所有端口信息
#show version 查看版本信息
#show mac-address-table 查看交换机当前MAC地址表信息
#show running-config 查看当前生效的配置信息
#show vlan 查看所有VLAN信息
#show vlan id 10 查看某一VLAN (如VLAN10)的信息
#show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1)
#show aggregateport 1 summary 查看聚合端口AG1的信息
#show spanning-tree 查看生成树配置信息
#show spanning-tree interface fastethernet 0/1 查看该端口的生成树状态
#show port-security 查看交换机的端口安全配置信息
#show port-security address 查看地址安全绑定配置信息
#show ip access-lists listname 查看名为listname的列表的配置信息
#show access-lists

端口的基本配置
(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式
(config)#interface range fa 0/1-2,0/5,0/7-9 进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式
(config-if)#speed 10 配置端口速率为10M,可选10,100,auto
(config-if)#plex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)
(config-if)#no shutdown 开启该端口
(config-if)#switchport access vlan 10 将该端口划入VLAN10中,用于VLAN
(config-if)#switchport mode trunk 将该端口设为trunk模式,用于Tag vlan
可选模式为access , trunk
(config-if)#port-group 1 将该端口划入聚合端口AG1中,用于聚合端口

聚合端口的创建
(config)# interface aggregateport 1 创建聚合接口AG1
(config-if)# switchport mode trunk 配置并保证AG1为 trunk 模式
(config)#int f0/23-24
(config-if-range)#port-group 1 将端口(端口组)划入聚合端口AG1中

生成树
(config)#spanning-tree 开启生成树协议
(config)#spanning-tree mode stp 指定生成树类型为stp
可选模式stp , rstp , mstp
(config)#spanning-tree priority 4096 设置交换机的优先级为4096 , 优先级值小为高。优先级可选值为0,4096,8192,……,为4096的倍数。交换机默认值为32768

VLAN的基本配置
(config)#vlan 10 创建VLAN10
(config-vlan)#name vlanname 命名VLAN为vlanname
(config-if)#switchport access vlan 10 将该端口划入VLAN10中
某端口的接口配置模式下进行
(config)#interface vlan 10 进入VLAN 10的虚拟端口配置模式
(config-if)# ip address 192.168.1.1 255.255.255.0 为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录的IP地址
(config-if)# no shutdown 启用该端口

端口安全
(config)# interface fastethernet 0/1 进入一个端口
(config-if)# switchport port-security 开启该端口的安全功能
1.配置最大连接数限制
(config-if)# switchport port-secruity maxmum 1 配置端口的最大连接数为1,最大连接数为128
(config-if)# switchport port-secruity violation shutdown
配置安全违例的处理方式为shutdown,可选为protect (当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable recovery来恢复)
2.IP和MAC地址绑定
(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1
接口配置模式下配置MAC地址xxxx.xxxx.xxxx和IP172.16.1.1进行绑定(MAC地址注意用小写)

三层路由功能(针对三层交换机)
(config)# ip routing 开启三层交换机的路由功能
(config)# interface fastethernet 0/1
(config-if)# no switchport 开启端口的三层路由功能(这样就可以为某一端口配置IP)
(config-if)# ip address 192.168.1.1 255.255.255.0
(config-if)# no shutdown
三层交换机路由协议
(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由
注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码
172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口)
(config)# router rip 开启RIP协议进程
(config-router)# network 172.16.1.0 申明本设备的直连网段信息
(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)
(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)

(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)
(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)
(config-router)# network 192.168.1.0 0.0.0.255 area 0
申明直连网段信息,并分配区域号(area0为骨干区域)

IP ACL:
交换机采用命名的访问控制列表;分标准(stand)和扩展(extended)两种
1.标准ACL
(config)#ip access-list stand listname 定义命名标准列表,命名为listname,stand为标准列表
(config-std-nacl)#deny 192.168.30.0 0.0.0.255 拒绝来自192.168.30.0网段的IP流量通过
注:deny:拒绝通过;可选:deny(拒绝通过)、permit(允许通过)
192.168.30.0 0.0.0.255:源地址及源地址通配符;可使用any表示任何IP
(config-std-nacl)#permit any
(config-std-nacl)#end 返回
2.扩展ACL
(config)#ip access-list extended listname
定义命名扩展列表,命名为listname,extended为扩展
(config-ext-nacl)#deny tcp 192.168.30.0 0.0.0.255 192.168.10.0 0.0.0.255 eq www 拒绝源地址为192.168.30.0网段的IP访问目的地址为192.168.10.0网段的WWW服务
注:deny:拒绝通过,可选:deny(拒绝通过)、permit(允许通过)
tcp: 协议名称,协议可以是udp, ip,eigrp, gre, icmp, igmp, igrp等等。
192.168.10.0 0.0.0.255:源地址及源地址通配符
192.168.30.0 0.0.0.255:目的地址及目的地址通配符
eq:操作符(lt-小于,eq-等于,gt-大于,neg-不等于,range-包含)
www:端口号,可使用名称或具体编号
可以使用的协议名称(或编号)和端口名称(或编号)请打?查询。
(config-ext-nacl)#permit ip any any 允许其它通过
(config-ext-nacl)#end 返回
(config)#interface vlan 10 进入端口配置模式
(config-if)# ip access-group listname in 访问控制列表在端口下in方向应用;可选:in(入栈)、out(出栈)
(config-if)#end 返回
注:配置ACL时,若只想对其中部分IP进行限制访问时,必须配置允许其流量通过,否则设备只会对限制IP进行处理,不会对非限制IP进行允许通过处理。

⑥ 怎样在锐捷交换机上配置vrrp、arp和mstp..

慢慢研究 、。。。。。。老师留的问题别老找枪手
交换机
密码
1234(config)#enable secret level 1 0 100
1234(config)#enable secret level 15 0 100
远程登入密码
1234(config)#line vty 0 4
1234(config-line)#password 100
1234(config-line)#end
交换机管理IP
1234(config)#interface vlan 1
1234(config-if)#ip address 192.168.1.10 255.255.255.0
1234(config-if)#no shutdown
修改交换机老化时间
1234(config)#mac-address-table aging-time 20
1234(config)#end
添删vlan
1234(config)#vlan 888
1234(config-vlan)#name a888
1234(config)#no vlan 888
添加access口
1234(config)#interface gigabitEthernet 0/10
1234(config-if)#switchport mode access
1234(config-if)#switchport access vlan 10
切换assess trunk
1234(config-if)#switchport mode access
1234(config-if)#switchport mode trunk
指定特定一个native vlan
1234(config-if)#switchport trunk native vlan 10
配置trunk口的许可vlan列表
1234(config-if)#switchport trunk allowed vlan ?
add Add VLANs to the current list
all All VLANs
except All VLANs except the following
remove Remove VLANs from the current list
速成树协议
1234(config)#spanning-tree
1234(config)#spanning-tree mode rstp/stp
配置网关:
switch(config)#ip default-gateway 192.168.1.254
交换机基本配置-常见查看命令
查看CPU利用率
show cpu
查看交换机时钟
show clock
查看交换机日志
show logging
查看交换机动态学习到的MAC地址表
show mac-address-table dynamic
查看当前交换机运行的配置文件
show running-config
查看交换机硬件、软件信息
show version
查看交换机的arp表
show arp
显示接口详细信息的命令
show interfaces gigabitEthernet 4/1 counters
接口配置
Switch(config)#interface gigabitethernet 0/1
把接口工作模式改为光口。
Switch(config-if)#medium-type fiber
把接口工作模式改为电口。
Switch(config-if)#medium-type copper
速度/双工配置
进入接口配置模式。
Switch(config)#interface interface-id
设置接口的速率参数,或者设置为auto。
Switch(config-if)#speed {10 | 100 | 1000 | auto }
设置接口的双工模式。
Switch(config-if)#plex {auto | full | half}
例子
Switch(config)#interface gigabitethernet 0/1
Switch(config-if)#speed 1000
Switch(config-if)#plex full
光口不能修改速度和双工配置,只能auto。
在故障处理的时候,如果遇到规律性的时断时续或掉包,在排除其他原因后,可以考虑是否和对端设备的速率和双工模式不匹配,尤其是两端设备为不同厂商的时候。
VLAN
建立VLAN 100
Switch (config)#vlan 100
该VLAN名称为ruijie
Switch (config)#name ruijie
将交换机接口划入VLAN 中:
range表示选取了系列端口1-48,这个对多个端口进行相同配置时非常有用。
Switch (config)#interface range f 0/1-48
将接口划到VLAN 100中。
Switch (config-if-range)#switchport access vlan 100
将接口划回到默认VLAN 1中,即端口初始配置。
Switch (config-if-range)#no switchport access vlan
Switch(config)#interface fastEthernet 0/1
该端口工作在access模式下
Switch(config-if)#switchport mode access
该端口工作在trunk模式下
Switch(config-if)#switchport mode trunk
Switch(config)#interface fastEthernet 0/2
设定VLAN要修剪的VLAN。
Switch(config-if)#switchport trunk allowed vlan remove 2-9,11-19,21-4094
取消端口下的VLAN修剪。
Switch(config-if)#no switchport trunk allowed vlan
生成树
开启生成树协议。
Switch(config)#spanning-tree
禁止生成树协议。
Switch(config)#no spanning-tree
配置生成树优先级:
配置设备优先级为4096。
Switch(config)#spanning-tree priority 4096
数值越低,优先级别越高。
端口镜像
配置G0/2为镜像端口。
Switch (config)# monitor session 1 destination interface G 0/2
配置G0/1为被镜像端口,且出入双向数据均被镜像。
Switch (config)# monitor session 1 source interface G 0/1 both
去掉镜像1。
Switch (config)# no monitor session 1
端口聚合
Switch(config)#interface fastEthernet 0/1
把端口f0/1加入到聚合组1中。
Switch (config-if)#port-group 1
把端口f0/1从聚合组1中去掉
Switch (config-if)#no port-group 1
建立ACL:
建立ACL访问控制列表名为ruijie,extend表示建立的是扩展访
Switch(config)# Ip access-list exten ruijie
问控制列表。
添加ACL的规则:
禁止PING IP地址为192.168.1.1的设备。
Switch (config-ext-nacl)#deny icmp any 192.168.1.1 255.255.255.0
禁止端口号为135的应用。
Switch (config-ext-nacl)# deny tcp any any eq 135
禁止协议为www的应用。
Switch (config-ext-nacl)#deny udp any any eq www
允许所有行为。
Switch(config-ext-nacl)# permit ip any any
将ACL应用到具体的接口上:
Switch (config)#interface range f 0/1
把名为ruijie的ACL应用到端口f 0/1上。
Switch (config-if)#ip access-group ruijie in
从接口去除ACL。
Switch (config-if)#no ip access-group ruijie in
删除ACL:
删除名为ruijie的ACL。
Switch(config)#no Ip access-list exten ruijie
增加ACE项后,是增加到ACL最后,不可以中间插入,如果要调整ACE的顺序,必须整个删除ACL后再重新配置。
端口安全
Switch (config)#interface range f 0/1
开启端口安全。
Switch(config-if)# switchport port-security
关闭端口安全。
Switch(config-if)# no switchport port-security
设置端口能包含的最大安全地址数为8。
Switch(config-if)# switchport port-security maximum 8
在接口fastethernet0/1配置一个安全地址00d0.f800.073c,并为其绑定一个IP地址192.168.1.1
Switch(config-if)# switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1
删除接口上配置的安全地址。
Switch(config-if)#no switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1
防ARP攻击
IP和MAC地址的绑定
Switch(config)#arp ip-address hardware-address [type] interface-id
Switch(config)#arp 192.168.12.111 00d0.f800.073c arpa g 0/1
绑定网关
进入指定端口进行配置。
Switch(config)#Interface interface-id
配置防止ip-address的ARP欺骗。
Switch(config-if)#Anti-ARP-Spoofing ip ip-address
防STP攻击
进入端口Fa0/1。
Switch(config)# inter fastEthernet 0/1
打开该端口的的BPDU guard功能。
Switch(config-if)# spanning-tree bpguard enable
关闭该端口的的BPDU guard功能。
Switch(config-if)# spanning-tree bpguard diaable
端口关闭后只能shutdown然后再no shutdown
或者重新启动交换机才能恢复!
防DOS/DDOS攻击
进入端口Fa0/1。
Switch(config)# inter fastEthernet 0/1
预防伪造源IP的DOS攻击的入口过滤功能。
Switch(config-if)#ip deny spoofing-source
关闭入口过滤功能只能在三层接口上配置。
Switch(config-if)#no ip deny spoofing-source
和ACL不能同时存在。
端口关闭后只能shutdown然后再no shutdown
或者重新启动交换机才能恢复!
防IP扫描攻击配置:
打开系统保护。
Switch(config)#system-guard enable
关闭系统保护功能。
Switch(config)#no system-guard
DHCP配置
打开DHCP Relay Agent:
Switch(config)#service dhcp
配置DHCP Server的IP地址:
Switch(config)#ip helper-address address
VRRP配置
Switch(config)#Interface interface-id
Switch(config-if)#Standby [group-number] ip ip-address
设置虚拟机的优先级。
standby [group-number] priority priority
三层交换机配置
SVI:
把VLAN 10配置成SVI。
switch (config)#interface vlan 10
给该SVI接口配置一个IP地址
switch (config-if)#ip address 192.168.1.1 255.255.255.0
Routed Port:
switch (config)#interface fa 0/1
把f 0/1变成路由口。
switch (config-if)#no switch
路由配置:
添加一条路由。
switch (config)#ip route 目的地址 掩码 下一跳
switch (config)#ip route 210.10.10.0 255.255.255.0 218.8.8.8

⑦ 如何在锐捷2126G交换机配置访问控制列表

能让我看看你的配置吗?
这样很难帮你解决

回复你:
你在FA0/1口上让45 41 44 59 都允许过去了
我就纳闷了 你到底是想允许还是阻止呢??

热点内容
华为电脑服务器系统进不去提示 发布:2024-10-08 00:13:42 浏览:490
登录密码如何获取 发布:2024-10-07 23:58:40 浏览:424
王者荣耀人机脚本 发布:2024-10-07 23:58:33 浏览:807
地标建筑脚本 发布:2024-10-07 23:48:51 浏览:242
sqlorderby 发布:2024-10-07 23:42:13 浏览:958
qq秒源码 发布:2024-10-07 23:41:37 浏览:471
51单片机编译器 发布:2024-10-07 23:28:04 浏览:798
安卓手机陌陌封设备了怎么搞 发布:2024-10-07 23:17:00 浏览:180
sql管理系统代码 发布:2024-10-07 23:00:51 浏览:524
安卓什么浏览器可以打开 发布:2024-10-07 23:00:51 浏览:121