This article provides a sample interface-mode configuration to make an MX device to behave like a switch, when ports are configured as access ports of the same VLAN. This setup can switch traffic only between access ports and between access ports and trunks ports.
R1-----------------------------------------R2---------------------------------------------------R3 192.168.100.1 (xe-0/0/0-access port) (xe-0/0/1-access port) 192.168.100.3/24
Configuration : R2 - Access ports Interface configuration :
interfaces { xe-0/0/0 { unit 0 { family bridge { interface-mode access; vlan-id 100; } } } xe-0/0/1 { unit 0 { family bridge { interface-mode access; vlan-id 100; } } }
R1 :
[edit interfaces xe-1/2/0] lab# show unit 0 { family inet { address 192.168.100.1/24; } }
R3 :
[edit interfaces xe-1/2/0] lab@R3# show unit 0 { family inet { address 192.168.100.3/24; }
Ping test between R1 and R3 and vice-versa; without any Bridge-Domain configuration: Test 1 - Ping from R3 to R1 :
lab@MX-240# run ping 192.168.100.1 PING 192.168.100.1 (192.168.100.1): 56 data bytes ^C --- 192.168.100.1 ping statistics --- 10 packets transmitted, 0 packets received, 100% packet loss
Test 2 - Ping from R1 to R3 :
lab@MX-240# run ping 192.168.100.3 PING 192.168.100.3 (192.168.100.3): 56 data bytes ^C --- 192.168.100.3 ping statistics --- 14 packets transmitted, 0 packets received, 100% packet loss
R2 Bridge Domain Configuration:
bridge-domains { test { vlan-id 100; } }
Ping test after configuring the Bridge-domain: R3 to R1 :
lab@MX-240# run ping 192.168.100.1 PING 192.168.100.1 (192.168.100.1): 56 data bytes 64 bytes from 192.168.100.1: icmp_seq=0 ttl=64 time=0.558 ms 64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.534 ms 64 bytes from 192.168.100.1: icmp_seq=2 ttl=64 time=0.545 ms 64 bytes from 192.168.100.1: icmp_seq=3 ttl=64 time=0.501 ms 64 bytes from 192.168.100.1: icmp_seq=4 ttl=64 time=0.504 ms 64 bytes from 192.168.100.1: icmp_seq=5 ttl=64 time=0.503 ms 64 bytes from 192.168.100.1: icmp_seq=6 ttl=64 time=0.545 ms 64 bytes from 192.168.100.1: icmp_seq=7 ttl=64 time=0.521 ms 64 bytes from 192.168.100.1: icmp_seq=8 ttl=64 time=0.547 ms 64 bytes from 192.168.100.1: icmp_seq=9 ttl=64 time=0.548 ms 64 bytes from 192.168.100.1: icmp_seq=10 ttl=64 time=0.548 ms 64 bytes from 192.168.100.1: icmp_seq=11 ttl=64 time=0.548 ms 64 bytes from 192.168.100.1: icmp_seq=12 ttl=64 time=0.492 ms
R1 to R3 :
lab@we-labmx4801# run ping 192.168.100.3 PING 192.168.100.3 (192.168.100.3): 56 data bytes 64 bytes from 192.168.100.3 icmp_seq=0 ttl=64 time=1.331 ms 64 bytes from 192.168.100.3: icmp_seq=1 ttl=64 time=0.655 ms 64 bytes from 192.168.100.3: icmp_seq=2 ttl=64 time=0.602 ms 64 bytes from 192.168.100.3: icmp_seq=3 ttl=64 time=0.584 ms ^C --- 192.168.100.3 ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss
Troubleshooting and Verification :
MAC flags (S -static MAC, D -dynamic MAC, L -locally learned SE -Statistics enabled, NM -Non configured MAC, R -Remote PE MAC) Routing instance : default-switch Bridging domain : test, VLAN : 100 MAC MAC Logical address flags interface 00:24:dc:b9:90:f7 D xe-0/0/1.0 80:71:1f:10:9c:1f D xe-0/0/0.0
Routing instance Bridge domain VLAN ID Interfaces default-switch test 100 xe-0/0/0.0 xe-0/0/1.0
Run the show bridge domain command:
Local interface: xe-0/0/1.0, Index: 322 Broadcast packets: 35 Broadcast bytes : 2100 Multicast packets: 0 Multicast bytes : 0 Flooded packets : 0 Flooded bytes : 0 Unicast packets : 2 Unicast bytes : 196 Current MAC count: 1 (Limit 8192) Local interface: xe-0/0/0.0, Index: 329 Broadcast packets: 7 Broadcast bytes : 420 Multicast packets: 0 Multicast bytes : 0 Flooded packets : 0 Flooded bytes : 0 Unicast packets : 7 Unicast bytes : 610 Current MAC count: 1 (Limit 8192)
Dec 17 - Specified that the Bridge domain configuration is on R2 for clarity.