简单的VPN-VRF配置(ENSP)

mikuku2个月前学习笔记57

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保存即可

相关文章

BGP边界网关小实验(cisco)

BGP边界网关小实验(cisco)

拓扑如上简单的BGP协议配置.zip端口配置略略先观察路由表只有一个路由BGP配置路由器3(中间这个):router bgp 200 //启动BGP协议 neighbo...

VLSM和CIDR与传统子网划分的区别

‌理解传统子网划分的局限性。掌握VLSM(可变长子网掩码)的核心原理与应用场景。掌握CIDR(无类域间路由)的核心原理与作用。明确VLSM、CIDR与传统子网划分的区别及互补性。‌二、传统子网划分的局...

简单的Qos演示(ensp)(如成)

简单的Qos演示(ensp)(如成)

拓扑如上首先配置中间交换机sys un in en //关闭信息 int vlanif 1 ip address 192.1...

简单的Prefix-list配置(EVE_ng)(未完成)

简单的Prefix-list配置(EVE_ng)(未完成)

拓扑如上这里就不教怎么去整这个环境了,网上很多这个模拟器的话pc地址我们需要在命令行里配,我这里就演示配置一个的,剩下都一样我们现在来看具体需求拒绝某一条具体的路由(与标准ACL一致)PC1ip&nb...

WEB架构

CDN原理:内容分发服务,旨在提高访问速度影响:隐藏真实IP,导致对目标测试错误为什么要使用第三方储存呢?静态文件会占用大量宽带加载速度提高对服务器本身空间进行节省影响:上传的文件或解析的问价均来自0...

配置标准ACL(cisco)

配置标准ACL(cisco)

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

发表评论    

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