思科 ASR 上的 L2 / L3

网络工程 思科 层2 第3层 点1q
2021-07-28 09:48:15

我是思科的新手,遇到以下问题:我有 3 个路由器。这些之间只有一个物理连接。VLAN 100 连接到 R1 和 R2。VLAN 200 连接到 R1、R2 和 R3。

R2 和 R3 之间的连接是端口通道(两个物理接口)。

我尤其对路由器 2 感兴趣....

所有路由器都运行 Cisco IOS XE 软件,版本 16.06.04。

在此处输入图片说明

路由器 1
接口 GE 0/0/0
- VLAN-ID 100,IP 192.168.1.1/24
- VLAN-ID 200,IP 192.168.2.1/24

路由器 2
接口 GE 0/0/0
- VLAN-ID 100,IP 192.168.1.2/24
- VLAN-ID 200,IP -

接口 GE 0/0/1
- VLAN-ID 200,IP -

路由器 3
接口 GE 0/0/0
- VLAN-ID 200,IP 192.168.2.2/24

谢谢!

保罗

这里是R2的配置:

网桥域 100
网桥域 200
接口端口通道2
 描述“to_R3”
 没有IP地址
 没有谈判汽车
 服务实例 200 以太网
  封装dot1q 200
  重写入口标签弹出 1 对称
  网桥域 200
接口千兆以太网0/0/0
 没有IP地址
 谈判汽车
 服务实例 200 以太网
  封装dot1q 200
  重写入口标签弹出 1 对称
  网桥域 200
 服务实例 100 以太网
  封装dot1q 100
  重写入口标签弹出 1 对称
  网桥域 100
接口千兆以太网0/0/1
 没有IP地址
 没有ip重定向
 没有ip无法访问
 没有 ip 代理-arp
 谈判汽车
 没有启用拖把
 通道组 2
接口千兆以太网0/0/2
 没有IP地址
 没有ip重定向
 没有ip无法访问
 没有 ip 代理-arp
 谈判汽车
 没有启用拖把
 通道组 2
接口 BDI100
 IP 地址 192.168.1.2 255.255.255.0
 封装dot1Q 100
2个回答

所以这里是有效的解决方案......首先 - 子接口下不支持桥接域!

测试台长这个样子 站立

我在 vMX 上创建了两个逻辑系统来模拟两个不同的路由器。ls1包含接口ge-0/0/0.200( tagged, VLAN 200, 192.168.200.1/24 ) 和ge-0/0/0.100( tagged, VLAN 100, 192.168.100.1/24 ); ls2 - 接口ge-0/0/1.200标记,VLAN 200, 192.168.200.2/24)。

  • vMX 软件 - 14.1R
  • CSRv 软件 - 3.17.01

虚拟机配置

logical-systems {
    ls1 {
        interfaces {
            ge-0/0/0 {
                unit 100 {
                    vlan-id 100;
                    family inet {
                        address 192.168.100.1/24;
                    }
                }
                unit 200 {
                    vlan-id 200;
                    family inet {
                        address 192.168.200.1/24;
                    }
                }
            }
        }
    }
    ls2 {
        interfaces {
            ge-0/0/1 {
                unit 200 {
                    vlan-id 200;
                    family inet {
                        address 192.168.200.2/24;
                    }
                }
            }
        }
    }
}
interfaces {
    ge-0/0/0 {
        flexible-vlan-tagging;
    }
    ge-0/0/1 {
        flexible-vlan-tagging;
    }
}

CSRv 配置

bridge-domain 100
bridge-domain 200
!
interface GigabitEthernet1
 no ip address
 negotiation auto
 service instance 100 ethernet
  encapsulation dot1q 100
  rewrite ingress tag pop 1 symmetric
  bridge-domain 100
 !
 service instance 200 ethernet
  encapsulation dot1q 200
  bridge-domain 200
 !
!
interface GigabitEthernet2
 no ip address
 negotiation auto
 service instance 200 ethernet
  encapsulation dot1q 200
  bridge-domain 200
 !
!
interface BDI100
 ip address 192.168.100.2 255.255.255.0

结果

CSRv#sh bridge-domain
Bridge-domain 100 (2 ports in all)
State: UP                    Mac learning: Enabled
Aging-Timer: 300 second(s)
    BDI100  (up)
    GigabitEthernet1 service instance 100
   AED MAC address    Policy  Tag       Age  Pseudoport
   0   0005.8671.C400 forward dynamic   299  GigabitEthernet1.EFP100
   -   001E.BDDB.CABF to_bdi  static    0    BDI100

Bridge-domain 200 (2 ports in all)
State: UP                    Mac learning: Enabled
Aging-Timer: 300 second(s)
    GigabitEthernet1 service instance 200
    GigabitEthernet2 service instance 200
   AED MAC address    Policy  Tag       Age  Pseudoport
   0   0005.8671.C401 forward dynamic   293  GigabitEthernet2.EFP200
   0   0005.8671.C400 forward dynamic   293  GigabitEthernet1.EFP200

root@vMX> ping logical-system ls1 192.168.200.2 count 5 size 1500
PING 192.168.200.2 (192.168.200.2): 1500 data bytes
1508 bytes from 192.168.200.2: icmp_seq=0 ttl=64 time=78.265 ms
1508 bytes from 192.168.200.2: icmp_seq=1 ttl=64 time=78.816 ms
1508 bytes from 192.168.200.2: icmp_seq=2 ttl=64 time=78.931 ms
1508 bytes from 192.168.200.2: icmp_seq=3 ttl=64 time=80.690 ms
1508 bytes from 192.168.200.2: icmp_seq=4 ttl=64 time=84.244 ms

--- 192.168.200.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 78.265/80.189/84.244/2.185 ms

root@vMX> ping logical-system ls1 192.168.100.2 size 1500 count 5
PING 192.168.100.2 (192.168.100.2): 1500 data bytes
1508 bytes from 192.168.100.2: icmp_seq=0 ttl=255 time=6.769 ms
1508 bytes from 192.168.100.2: icmp_seq=1 ttl=255 time=1.886 ms
1508 bytes from 192.168.100.2: icmp_seq=2 ttl=255 time=2.698 ms
1508 bytes from 192.168.100.2: icmp_seq=3 ttl=255 time=2.229 ms
1508 bytes from 192.168.100.2: icmp_seq=4 ttl=255 time=2.940 ms

--- 192.168.100.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.886/3.304/6.769/1.770 ms

您可以在单个接口下创建多个服务实例,以通过桥域互连更多设备。

希望这会有所帮助!

正如@andreyprokhorov 所提到的,您可以创建一个桥接组。在 IOS-XE 上,它被称为桥接域。Cisco 有一个完整的解释,但这里有一个示例:

interface GigabitEthernet0/0/0.1
no ip address
negotiation auto
cdp enable
service instance 100 ethernet
encapsulation dot1q 200
bridge-domain 100
!
interface GigabitEthernet0/0/0.2
no ip address
negotiation auto
cdp enable
service instance 100 ethernet
encapsulation dot1q 200
bridge-domain 100