分享页面
已经找到“” 的记录6249条
在思科设备上配置VRRP MSTP实现网关冗余和负载分担
 

拓扑如下图所示:

具体配置如下:

SW3:

先创建vlan10,20

vlan 10

vlan 20

然后在接口下划分trunk、access模式

interface Ethernet0/3

switchport mode access

switchport access vlan 10

interface Ethernet1/0

switchport mode access

switchport access vlan 20

int range e0/1 , e0/2

switchport trunk encapsulation dot1q

switchport mode trunk

switchport trunk allowed vlan 10,20

配置mstp

spanning-tree mode mstp

spanning-tree mst configuration

name qgtest

revision 123

instance 10 vlan 10

instance 20 vlan 20

SW1:

先创建vlan10,20

vlan 10

vlan 20

配置链路聚合和trunk口

interface range e0/2 , e0/0 , e0/1

switchport trunk encapsulation dot1q

switchport mode trunk

switchport trunk allowed vlan 10,20

interface range e0/2 , e0/0

channel-group 1 mode on

配置mstp

spanning-tree mode mstp

spanning-tree mst configuration

name qgtest

revision 123

instance 10 vlan 10

instance 20 vlan 20

spanning-tree mst 10 root primary

spanning-tree mst 20 root sec

配置vrrp

interface Vlan10

ip address 192.168.10.253 255.255.255.0

vrrp 10 ip 192.168.10.254

vrrp 10 priority 200

interface Vlan20

ip address 192.168.20.252 255.255.255.0

vrrp 20 ip 192.168.20.254

vrrp 20 priority 100

SW2:

先创建vlan10,20

vlan 10

vlan 20

配置链路聚合和trunk口

interface range e0/2 , e0/0 , e0/1

switchport trunk encapsulation dot1q

switchport mode trunk

switchport trunk allowed vlan 10,20

interface range e0/2 , e0/0

channel-group 1 mode on

配置mstp

spanning-tree mode mstp

spanning-tree mst configuration

name qgtest

revision 123

instance 10 vlan 10

instance 20 vlan 20

spanning-tree mst 20 root primary

spanning-tree mst 10 root sec

配置vrrp

interface Vlan20

ip address 192.168.20.253 255.255.255.0

vrrp 20 ip 192.168.20.254

vrrp 20 priority 200

interface Vlan10

ip address 192.168.10.252 255.255.255.0

vrrp 10 ip 192.168.10.254

vrrp 10 priority 100

备注:如果SW1有上行接口和上行链路时,其中一个发生故障,VRRP默认是无法感知的,即主备状态无法切换,数据包无法发送出去,这是就要用到track功能。具体配置如下:

SW1/SW2:

vrrp 10 track 1 decrement 150

track 1 int g0/0/3 line-protocol

假设G0/0/3为上行口,配置完这条命令之后,即当上行链路发生故障时,其优先级减少150,然后当前优先级小于Backup状态的三层交换机,则主备状态发生切换。
在思科设备上配置vpls提供二层vpn服务
 

VPLSVirtual Private LAN Service,虚拟专用局域网服务)是在公用网络中提供的一种点到多点的L2VPN业务。VPLS使地域上隔离的用户站点能通过城域网或广域网相连,并且使各个站点间的连接效果像在一个LAN中一样。本文将介绍如何在思科设备上配置vpls以提供二层vpn服务。拓扑如下图所示:

具体配置如下:

配置PE1

l2 vfi PE1-VPLS-A manual (进入二层vri手动配置模式)

vpn id 100 (为vlps域建立一个vpn-id )

neighbor 2.2.2.2 encapsulation mpls (指定远程对等的路由器ID与隧道封装模式,属性用于设置模拟VC)

neighbor 3.3.3.3 encapsulation mpls (指定远程对等的路由器ID与隧道封装模式,属性用于设置模拟VC)

interface Loopback 0

ip address 1.1.1.1 255.255.255.255

interface FastEthernet0/0 (这个配置CE设备接口,可以有多个层2接口在一个VLAN。)

switchport

switchport mode dot1qtunnel

switchport access vlan 100

interface vlan 100

no ip address (关闭接口ip服务)

xconnect vfi PE1-VPLS-A(将二层VFI与vlan100绑定)

vlan 100

state active(将二层VFI与vlan100绑定)

配置PE2:

l2 vfi PE2-VPLS-A manual

vpn id 100

neighbor 1.1.1.1 encapsulation mpls

neighbor 3.3.3.3 encapsulation mpls

interface Loopback 0

ip address 2.2.2.2 255.255.255.255

interface FastEthernet0/0

switchport

switchport mode dot1qtunnel

switchport access vlan 100

interface vlan 100

no ip address

xconnect vfi PE2-VPLS-A

This is the enablement of the Layer 2 VLAN instance

vlan 100

state active

配置 PE3:

l2 vfi PE3-VPLS-A manual

vpn id 100

neighbor 1.1.1.1 encapsulation mpls

neighbor 2.2.2.2 encapsulation mpls

interface Loopback 0

ip address 3.3.3.3 255.255.255.255

interface FastEthernet0/1

switchport

switchport mode dot1qtunnel

switchport access vlan 100

interface vlan 100

no ip address

xconnect vfi PE3-VPLS-A

vlan 100

state active
show mpls l2 vc 

命令 提供关于VC状态的信息:

show vfi 命令提供VFI状态信息查询:

show mpls 12transport vc det命令提供VC状态信息详细查询:

在思科交换机上配置ACL策略防止勒索病毒传播
 

勒索病毒主要通过TCP/UDP135137138139445端口攻陷用户的计算机并加密用户的文件达到虚拟货币的目的,在企业内部特别是个人计算机居多的情况下更容易中招。本文将介绍如何通过在交换机上部署ACL策略控制这几个端口的访问达到防止勒索必读传播的目的,防止其大范围传播造成严重损失。

具体配置如下:

首先,在全局模式下创建ACL

sw(config)#ip access-list extended deny445

sw(config-ext-nacl)# 10 deny tcp any any range 135 139

sw(config-ext-nacl)# 20 deny udp any any range 135 139

sw(config-ext-nacl)# 30 deny tcp any any eq 445

sw(config-ext-nacl)#100 permit ip any any

exit

然后进入具体接口(物理接口或vlan)下:

sw(config)#int vlan 27

ACL运用到接口上:

sw(config-if)#ip access-group deny445 in

sw(config-if)#ip access-group deny445 out

通过ipmi调整风扇转速
 

1.首先设置ipmiIP

这个要注意一点的是一定要和你的网络的网段是一样的,其他的话没有什么可以说的,把服务器开机之后进入设置ipmi的界面设置就好了,并且设置好账号和密码

 

2.跳板机安装ipmitool

3.调节风扇转速

首先你要输入下面的命令把风扇转速设置为手动的

ipmitool -I lanplus -U ipmi用户名 -P ipmi密码 -H 服务器地址 raw 0x30 0x30 0x01 0x00

 

之后就可以调节转速了

 

ipmitool -I lanplus -U ipmi用户名 -P ipmi密码 -H 服务器地址 raw 0x30 0x30 0x02 0xff 0x18

 

要值得关注的是,上面16进制的最后一个16进制,当你输入0x18的时候几乎就是风扇转速最小的时候,当你不断调节大,比如下面

 

ipmitool -I lanplus -U ipmi用户名 -P ipmi密码 -H 服务器地址 raw 0x30 0x30 0x02 0xff 0x60

 

这个几乎就是风扇最大的转速,我现在的转速是

ipmitool -I lanplus -U ipmi用户名 -P ipmi密码 -H 服务器地址 raw 0x30 0x30 0x02 0xff 0x10

 

思科设备配置基于应用(协议)的策略路由
 

拓扑如下:

要求:TCP的报文设置出接口f1/0,UDP设置出接口f2/0

具体配置:

R2(config)#access-list 110 permit tcp any any

R2(config)#access-list 111 permit udp any any

R2(config)#route-map qgtest permit 10

R2(config-route-map)#match ip address 110

R2(config-route-map)#set interface f1/0

R2(config-route-map)#exit

R2(config)#route-map qgtest permit 20

R2(config-route-map)#match ip address 111

R2(config-route-map)#set interface f2/0

R2(config)#int f0/0

R2(config-if)#ip policy route-map qgtest
思科设备配置基于报文大小的策略路由
 

拓扑如下:

要求:R2f0/0端口上应用基于报文大小的策略路由haha,为大小小于100Byte的报文设置出接口f1/0,101-1000B的报文设置出口f2/0

具体配置:

1:定义route-map

R2(config)#route-map qgtest permit 10

R2(config-route-map)#match length 1 100

R2(config-route-map)#set interface f1/0

R2(config-route-map)#exit

R2(config)#route-map qgtest permit 20

R2(config-route-map)#match length 101 1000

R2(config-route-map)#set interface f2/0

R2(config-route-map)#exit

2:将route-map调用到接口上

R2(config)#int f0/0

R2(config-if)#ip policy route-map qgtest
通过GRE隧道解决OSPF非骨干区域无ABR的问题
 

拓扑如下图所示:

Area 2区域没有ABR(区域边界路由器),也就没有3LSA(网络汇总LSA,由ABR路由器发送网络汇总LSA到一个区域,用来通告该区域外部的目的地址),因此需要让R2成为ABR。这个问题可以通过在R1R2上建立GRE隧道解决。具体配置如下:

R1:

interface Tunnel0/0/0 \\创建GRE隧道

ip address 12.1.1.1 255.255.255.0

tunnel-protocol gre

source 192.168.12.1

quit

ospf 1

area 0.0.0.0

network 12.1.1.1 0.0.0.0 \\将Tunnel0/0/0加入OSPF区域0中

R2:

interface Tunnel0/0/0

ip address 12.1.1.2 255.255.255.0

tunnel-protocol gre

source 192.168.12.2

quit

ospf 1

area 0.0.0.0

network 12.1.1.2 0.0.0.0
在华为路由器上配置静态路由协议实现跨网段互通
 

静态路由是一种固定的路由方式,由网络管理员逐项加入路由表,一般应用于小型和简单的网络环境中。本文将介绍如何在华为路由器上配置静态路由协议,实现不同网段的网络互通。

 

1.拓扑结构

如下图所示:

A.两台路由器(R1R2)通过点到点IP地址(10.10.10.0/30)互联;

B.A区用户网段为:192.168.10.0/24PC1IP地址为:192.168.10.2,用户网段的网关为192.168.10.1(配置在R1E0/0/0接口上);

C.B区用户网段为:172.16.10.0/24PC2IP地址为:172.16.10.2,用户网段的网关为172.16.10.1(配置在R2E0/0/0接口上)。

2.操作目的

使不同网段的主机(PC1PC2)网络能相互ping通。

3.IP地址配置

R1

R2

PC1

PC2

4.静态路由配置

华为设备静态路由命令格式:

ip route-statuc [目的网段] [目的网段的掩码] [下一跳地址|出接口]

具体配置如下:

R1

R2

5.验证配置

A.查看路由表,R1R2各自有一条指向对方接口IP地址的静态路由:

B.不同网段的设备(PC1PC2)互ping

PC1 ping PC2

PC2 ping PC1

6.总结

通过上述最基本的静态路由配置操作,成功实现不同网段的网络互通。在实际组网中,可能存在需要同时运行静态路由(或默认路由,即目的网段配置为0.0.0.0/0的静态路由)和动态路由协议的情况,应根据实际需求灵活配置。

在华为路由器上配置基本的BGP协议传递路由信息
 

拓扑如下图所示:

上图中AR1AR3形成ibgp邻居,区域13AR2AR4形成ibgp邻居,区域24AR1AR2形成ebgp对等体(邻居)。为了让AR3AR4互通,需要通过AR1AR2相互传递路由给对端的bgp区域,让区域13和区域24通过bgp协议相互学习到对方的路由。因为bgp只负责控制路由,而底层依然是靠igp来完成寻址建立tcp连接。所以需要使用igp路由使得bgp对等体可以建立tcp连接相互形成bgp对等体,对等体形成后AR1AR2需要分别将自己从igbp邻居学到的路由宣告给ebgp邻居,从ebgp邻居学到的路由宣告给ibgp邻居,达到as13as24相互通信的目的。

具体配置如下:

R1:

interface GigabitEthernet0/0/0

ip address 12.1.1.1 255.255.255.0

interface GigabitEthernet0/0/1

ip address 13.1.1.1 255.255.255.0

interface LoopBack0

ip address 1.1.1.1 255.255.255.255

quit

bgp 13

router-id 1.1.1.1

peer 2.2.2.2 as-number 24 \\与R2建立ebgp邻居

peer 2.2.2.2 ebgp-max-hop 2 \\ebgp邻居允许的最大跳数修改为2(因为不是直连而是用loopback0接口)

peer 2.2.2.2 connect-interface LoopBack0 \\更新发送bgp报文的接口为loopback0接口

peer 3.3.3.3 as-number 13 \\与R3建立ibgp对等体

peer 3.3.3.3 connect-interface LoopBack0

ipv4-family unicast

network 3.0.0.0 \\宣告从R3这个ibgp邻居学到的路由(给R2这个ebgp邻居)

network 13.1.1.0 255.255.255.0 \\宣告自己的直连路由给ebgp邻居

peer 2.2.2.2 enable \\指定与邻居2.2.2.2开启MP-BGP功能,iPv4地址族默认开启

peer 3.3.3.3 enable

peer 3.3.3.3 next-hop-local \\从ebgp邻居学习到的路由传递给ibgp邻居时,路由的下一跳修改为自己

quit

quit

rip 1 \\使用igp路由搭建底层寻址

undo summary

network 1.0.0.0

network 13.0.0.0

quit

ip route-static 2.2.2.2 255.255.255.255 12.1.1.2 \\R1与R2建立ebgp对等体需要建立tcp连接,这里用静态做底层的寻址

R3:

interface GigabitEthernet0/0/0

ip address 13.1.1.3 255.255.255.0

interface LoopBack0

ip address 3.3.3.3 255.255.255.255

quit

bgp 13

router-id 3.3.3.3

peer 1.1.1.1 as-number 13

peer 1.1.1.1 connect-interface LoopBack0

ipv4-family unicast

peer 1.1.1.1 enable

quit

quit

rip 1

undo summary

network 3.0.0.0

network 13.0.0.0

R2:

interface GigabitEthernet0/0/0

ip address 12.1.1.2 255.255.255.0

interface GigabitEthernet0/0/1

ip address 24.1.1.2 255.255.255.0

interface LoopBack0

ip address 2.2.2.2 255.255.255.255

quit

bgp 24

router-id 2.2.2.2

peer 1.1.1.1 as-number 13 \\与R1建立ebgp对等体

peer 1.1.1.1 ebgp-max-hop 2

peer 1.1.1.1 connect-interface LoopBack0

peer 4.4.4.4 as-number 24 \\与R4建立ibgp对等体

peer 4.4.4.4 connect-interface LoopBack0

ipv4-family unicast

network 4.4.4.4 255.255.255.255

network 24.1.1.0 255.255.255.0

peer 1.1.1.1 enable

peer 4.4.4.4 enable

peer 4.4.4.4 next-hop-local

quit

quit

ospf 1

area 0.0.0.0

network 2.2.2.2 0.0.0.0

network 24.1.1.2 0.0.0.0

quit

ip route-static 1.1.1.1 255.255.255.255 12.1.1.1

R4:

interface GigabitEthernet0/0/0

ip address 24.1.1.4 255.255.255.0

interface LoopBack0

ip address 4.4.4.4 255.255.255.255

quit

bgp 24

router-id 4.4.4.4

peer 2.2.2.2 as-number 24

peer 2.2.2.2 connect-interface LoopBack0

ipv4-family unicast

peer 2.2.2.2 enable

quit

quit

ospf 1

area 0.0.0.0

network 4.4.4.4 0.0.0.0

network 24.1.1.4 0.0.0.0
在华为路由器上配置vrrp实现网关冗余
 

虚拟路由冗余协议VRRPVirtual Router Redundancy Protocol)是通过把几台路由设备联合组成一台虚拟的路由设备,将虚拟路由设备的IP地址作为用户的默认网关实现与外部网络通信。当网关设备发生故障时,VRRP机制能够选举新的网关设备承担数据流量,从而保障网络的可靠通信。本文将介绍如何在华为路由器上配置vrrp协议实现网关的冗余。拓扑如下图所示:

具体配置如下:

R1:

[R1]interface g0/0/0

[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24

[R1]interface g0/0/1

[R1-GigabitEthernet0/0/1]ip address 192.168.13.1 24

R2:

[R2-GigabitEthernet0/0/0]ip add

[R2-GigabitEthernet0/0/0]ip address 192.168.1.253 24

[R2-GigabitEthernet0/0/0]int g0/0/1

[R2-GigabitEthernet0/0/1]ip add

[R2-GigabitEthernet0/0/1]ip address 192.168.23.1 24

R3:

[R3]interface g0/0/0

[R3-GigabitEthernet0/0/0]ip ad

[R3-GigabitEthernet0/0/0]ip address 192.168.13.2 24

[R3]interface g0/0/0

[R3-GigabitEthernet0/0/0]ip ad

[R3-GigabitEthernet0/0/0]ip address 192.168.13.2 24

[R3-LoopBack1]ip address 10.0.0.1 24

R1、R2配置vrrp,并监控g0/0/1:

[R1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.250

[R1-GigabitEthernet0/0/0]vrrp vrid 1 track interface g0/0/1 reduced 50




[R2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.250

[R2-GigabitEthernet0/0/0]vrrp vrid 1 track interface g0/0/1 reduced 51

R1、R2、R3配置静态路由,确保全网互通:

[R1]ip route-static 10.0.0.1 255.255.255.0 192.168.13.2

[R2]ip route-static 10.0.0.1 255.255.255.0 192.168.23.2

[R3]ip route-static 192.168.1.0 255.255.255.0 192.168.13.1

[R3]ip route-static 192.168.1.0 255.255.255.0 192.168.23.1

测试:

R1上查看vrrp

R2上查看vrrp

PC上测试:

模拟R2->R3线路故障,将R3G0/0/0shutdown,测试路由:

PC上跟踪路由:

R2上看vrrp

如上图所示,vrrp自动切换R2master路由,链路备份成功。

扫码添加专属客服
扫码关注公众号