简单的VPN-VRF配置(ENSP)

mikuku6个月前学习笔记186

image.png

拓扑如上

简单的VRF配置.zip

首先我们配置中间的三层交换机

sys //进入配置模式
un in en //关闭消息提醒
ip vpn-instance VRF-A  //创建VRF实例
 route-distinguisher 100:1 //用于标记VRF,区别不同VRF相同IP
 vpn-target 100:1 export-extcommunity //VPN路由导入,使交换机能识别VRF内的路由
 vpn-target 100:1 import-extcommunity
ip vpn-instance VRF-B
 route-distinguisher 100:2
 vpn-target 100:2 export-extcommunity
 vpn-target 100:2 import-extcommunity
 q //ensp里退出是这个也就是quit
 vlan batch 10 20 //创建两个vlan
 interface Vlanif 10
 ip binding vpn-instance VRF-A //把vlan10绑定到分配的VRF
 ip address 192.168.1.1 255.255.255.0
 undo shutdown
interface Vlanif 20
 ip binding vpn-instance VRF-B
 ip address 192.168.2.1 255.255.255.0
 undo shutdown
 int e0/0/2
 port link-type access
 port default vlan 10 //连接左边路由器
 int e0/0/3
 port link-type access
 port default vlan 20
 int e0/0/1
 port link-type trunk //更改端口为trunk模式
 port trunk allow-pass vlan all //放行所有vlan
 //下面这步最后再来配,现在先去配其他设备
 ip route-static vpn-instance VRF-A 10.0.0.0 255.255.255.0 192.168.1.2 //添加静态路由,保证数据可以转发出去
ip route-static vpn-instance VRF-B 10.0.0.0 255.255.255.0 192.168.2.2

配置左边路由器

interface GE 0/0/0
 ip address 192.168.1.2 255.255.255.0
 undo shutdown
 interface GE 0/0/1
 ip address 10.0.0.1 255.255.255.0
 undo shutdown
 //
 ip route-static 192.168.1.0 255.255.255.0 10.0.0.2

右边

interface GE 0/0/0
 ip address 192.168.2.2 255.255.255.0
 undo shutdown
 interface GE 0/0/1
 ip address 10.0.0.1 255.255.255.0
 undo shutdown
 //
 ip route-static 192.168.2.0 255.255.255.0 10.0.0.2

二层交换机

vlan batch 10 20
int g0/0/2
port link-type access
 port default vlan 10
 int g0/0/3
 port link-type access
 port default vlan 20
 int g0/0/1
 port link-type trunk
 port trunk allow-pass vlan all

配到这里回去看看静态路由配置

现在就可以发现路由已经被隔离了,只有单边可以互通image.png

记得配置完成后保存配置

退出到<>这个状态使用save保存即可

相关文章

简单的RIP配置(cisco)

简单的RIP配置(cisco)

拓扑如上简单的RIP配置.zip我们前面已经学习过静态路由的配置,所以可以理解如果不配置静态路由的话这里两台PC机肯定是不能通信的静态路由这里就不过多赘述,我们直接来看怎么用RIP来达到同样的效果多层...

配置标准ACL(cisco)

配置标准ACL(cisco)

拓扑如上ACL配置.zip基础的路由器配置就不过多赘述我们配置一下左边路由器的静态路由en conf t ip route 172.16.1.0 255.2...

信息安全管理与评估赛题一(模块一)(10)

信息安全管理与评估赛题一(模块一)(10)

笔记文件下载链接:使用poweshell:powershell.exe -Command "Invoke-WebRequest -Uri http:/...

网络平台搭建与维护

网络平台搭建与维护

基础知识:MAC物理地址主要用于交换机识别进行二层通信,每一个网卡的mac地址都是独一无二的IP/IPV6这就不需要我多说了吧~至于IPV6的话我来说说他是由128位二进制,由16进制来表示以:分割,...

交换机的端口聚合配置(思科模拟)

交换机的端口聚合配置(思科模拟)

首先我们先得知道为什么会有端口聚合首先我们要知道生成树的问题生成书数最大的问题就是接口阻塞被阻塞的端口就是浪费的资源,两个接口只有一个接口在工作。那么端口聚合就由此而来,把两条网线聚合成一条。端口聚合...

简单的静态路由配置(cisco)

简单的静态路由配置(cisco)

拓扑如上静态路由的简单配置.zip静态路由就是非直连网络中,路由器的路由表中不会自动获取到到达那个网络的路由,所以需要我们自己手动配置一条静态路由来指向他。首先观察路由器三,可以观察到他的直连路由有1...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。