简单的VPN-VRF配置(ENSP)

mikuku3个月前学习笔记112

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

相关文章

配置标准ACL(cisco)

配置标准ACL(cisco)

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

神州数码交换机+ac+ap简单配置(如成)

神州数码交换机+ac+ap简单配置(如成)

拓扑如上,用思科模拟一下拓扑,上面的是三层交换机,中间的是无线ac,最后是无线ap首先看交换机配置en conf t hostname WLAN-2F vlan 1...

简单的IPV6的配置(cisco)

简单的IPV6的配置(cisco)

拓扑如上首先配置一下PC和路由器的端口地址路由器0en conf t ipv6 unicast-routing  //开启ipv6单播功能,不然无法通信,而...

默认路由的配置(cisco)

默认路由的配置(cisco)

拓扑如上简单的默认路由配置.zip路由器端口配置就不过多赘述首先我们看一下计算机通信情况,可以看到无法通信首先我们配置一下路由器2的静态路由ip route 172.16.1.0&...

简单的NAT配置(cisco)

简单的NAT配置(cisco)

拓扑如上模拟一下内网访问外网服务器使用nat转换一下地址端口配置略过然后为了实现通信我们还有配置一下路由协议,这里我用的是RIP路由器1en conf t router rip...

Test

        这是一个实验<h2>这是在实验标签</h2>...

发表评论    

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