In many Ethernet testing use cases its always convenient to have an option of doing a real Ethernet loopback. The key to Ethernet loopback testing is for the device doing the loopback function to swap the source and destination MAC addresses within the Ethernet frame. The reason for this swap is to make the frame appear to be sourced from the destination of the original frame and destined to the original source.
With that functionality available we can connect an Ethernet test set, such as those from EXFO or JDSU, and run an Ethernet test with one test kit and one technician. Having an Ethernet test set on each side of a link is not needed in this case.
I verified this configuration in a lab environment using a Cisco ASR901 router and a laptop. I applied the following configuration of the ASR901 router:
interface gigabitEthernet0/2 service instance 1 ethernet encapsulation untagged bridge domain 3 end ! !
This configuration creates a service instance on an GigE interface that matches untagged traffic and forwards it to bridge-domain 3. I then connected my laptop to port Gig0/2 and once the interface is up I issued ‘ethernet loopback’ command in EXEC mode.
ethernet loopback start local interface gigabitEthernet 0/2 service instance 1 facility source mac-address d4be.d930.e0d0 destination mac-address 255.255.255 timeout 9000 !
This command tells the A901 router to perform an Ethernet loopback on interface Gig0/2, service instance 1. This will be a facility loopback, which means it will be a loopback on an interface back out that same interface. It will match any frames sourced from MAC address d4be.d930.e0d0 and the perform a mac swap of the source to destination and destination to source.
In order to test this I placed a static ARP entry on my PC so I could avoid performing ARPs for this test. To do this I issued the following command:
arp -s 10.10.10.1 02-55-02-55-02-55
I previously had set the IP address on my PC to 10.10.10.10 255.255.255.0.
Once this once complete I issued a ping command.
This resulted in the following output in Wireshark on my PC:
This shows the ICMP echo (ping) message sent with src MAC of the PC and destination of the fictitious destination. As expected.
We then receive a packet that has been loopbacked by the ASR901 router.
You notice it was swapped and now the src is the fictitious MAC address and the destination is now the PC. Notice that the IP header is unchanged, the SRC and DST IP addresses remain the same throughout.
Once testing is complete you can remove the loopback by issuing the following command:
ethernet loopback stop local interface gigabitEthernet 0/2 service instance 1