F5 Lab 1.22 MAC Masquerading

F5 Lab 1.22 MAC Masquerading

After configuring HA Group for my F5 HA on my last article here, the next thing is how to optimize the failover in the event of failure. One of the method to optimize the failover process is implementing MAC Masquerading. By default, when failover is triggered the F5 will send GARP (Gratuitous Address Resolution Protocol) packet to the servers/other devices for requesting the servers/other devices to update their ARP cache with the new MAC address. Let's see the diagram below for how it works, when on the steady state not using MAC Masquerading:

Figure 1. Steady State HA-Pair

Servers ARP Table and Switch MAC Address Table:

Figure 2. Steady Servers ARP Table and Switch MAC Address Table

All the respond for the traffic to the floating IP address is handled by F5-HA1. The MAC address for floating IP which used for server's gateway is the MAC address on F5-HA1 or the active device.

On the event of failure, the floating IP address will move to the F5-HA2 then the new active F5 in this case F5-HA2 will sends GARP to servers and switch. This GARP used to updates the MAC address of the floating IP on their ARP table and switch MAC address table.

Figure 3. Failover Process without MAC Masquerading

After GARP request received, the switch will update MAC address table dan the servers will update the ARP table as below:

Figure 4. After Failover Servers ARP Table and Switch MAC Address Table

The floating IP's MAC address will change to the MAC address which coming from F5-HA2.

Let's verify and do the test on the lab for scenario MAC masquerading is not implemented:

  • Switch MAC Address Table

Figure 5. Switch MAC Address Table on The Lab

  • Server-1 ARP Table

Figure 6. Server ARP Table on The Lab

  • Failover Test

Figure 7. Failover Test on The Lab without MAC Masquerading

When test the failover by shutdown the interface on the switch server to current active F5 on F5-HA1, then F5 immediately failover to F5-HA2 and the ping is dropped for a while.

Figure 8. GARP Packet on F5-HA2 without MAC Masquerading

From the packet capture on the F5-HA2 towards the server switch, it shows there are some GARP packet captured. The sender of the packet is MAC address of F5-HA2 (50:7f:a0:00:09:01) and the destination is broadcast MAC address (ff:ff:ff:ff:ff:ff). This packet is sends to all endpoints to update the ARP table for IP address 192.0.2.254 from MAC address F5-HA1 to MAC address of F5-HA2 (50:7f:a0:00:09:01).

Let's implement MAC Masquerading to our traffic group. The MAC Masquerading is assigned per traffic group, the steps are:

1. Choose MAC Address for MAC Masquerading

The MAC address on the networking system is must be unique to avoiding confuse on the network. For the MAC masquerading, F5 recommends to custom existing physical MAC address on the device by using this guideline.

2. Add the MAC Address to traffic group.

By using the converting based on guideline on the step 1, my custom MAC is 52:fe:54:00:04:01 then add to the traffic group. Then save the configuration.

Figure 9. Traffic Group Configuration

3. After adding the MAC Masquerading, it will need to sync the configuration then Sync the config.

Figure 10. Sync Configuration

Let's verify and do the test on the lab for scenario MAC masquerading is implemented:

  • Server-1 ARP Table

Figure 11. Server ARP Table on The Lab with MAC Masquerading

The server ARP table shows the floating IP address is changed to new custom MAC address.

  • Switch MAC Address Table

Figure 12. Switch MAC Table on The Lab with MAC Masquerading

The switch server is already learn new custom MAC address for MAC Masquerading, it learns from interface connected to F5-HA1 on port Gi0/0 interface.

  • Failover Test

Figure 13. Failover Test on The Lab with MAC Masquerading

When test the failover by shutdown the interface on the switch server to current active F5 on F5-HA1, then F5 immediately failover to F5-HA2.

Figure 14. GARP Packet on F5-HA2 with MAC Masquerading

Although the ARP table on the endpoint is doesn't need to be updated but GARP packet is still need to be existed.

Figure 15. MAC Masquerading Address Learning on Switch

The purpose of the GARP packet is for MAC address learning process on the switch because when failover occurs, the MAC Masquerade address is moving from the port towards F5-HA1 on interface Gi0/0 to F5-HA2 on interface Gi0/1. Based on the results, the MAC Masquerading is useful for improving convergence time because imagine if there are many endpoints need to update the ARP table it will take many time to network to be converged and by leveraging the MAC Masquerading it will shorten the process.


References:



Daoshan Li

Security Architect, CISSP, CCSP, GSSP-JAVA

1 个月

Thanks for sharing! In terms of MAC Masquerading, if you run the command mentioned by the guideline on both F5-HA1 and F5-HA2 respectively, I guess, you'd get different base MACs, right? How could you decide to make the new MAC Masquerading address based on the base mac for F5-HA1 in your case rather than F5-HA2? or can use either of those two base macs? `tmsh show sys hardware | grep -i "base mac"`

回复
Amirul Khan

Senior Network Engineer (Infra Cloud Network Security Operation at Grameenphone)

2 个月

Useful tips

回复
Muhamad H.

IT enthusiast

2 个月

Great advice What is the simulator for this lab?

回复

要查看或添加评论,请登录

Deni Ramdani的更多文章

  • F5 Lab 1.21: HA Group

    F5 Lab 1.21: HA Group

    I have configured HA for my F5 based on this article, but with that configuration F5 will failover only when the active…

  • F5 Lab 1.20: Configuring Forwarding Virtual Server

    F5 Lab 1.20: Configuring Forwarding Virtual Server

    F5 by default is an device which block all traffic until the administrator explicitly allow it. Based on the lab, I…

  • F5 Lab 1.19: Configuring Route-Domain

    F5 Lab 1.19: Configuring Route-Domain

    After I make an update to my lab topology on my last article here, I start to configure route domain in F5 for…

    2 条评论
  • F5 Lab 1.18: Lab Topology Update

    F5 Lab 1.18: Lab Topology Update

    After creating simple lab created which focusing to F5 basic, I have updated my topology to integrate the F5 with…

    1 条评论
  • F5 Lab 1.17: Pool Member/Node Manual Resume

    F5 Lab 1.17: Pool Member/Node Manual Resume

    When deploying a service to F5 by creating virtual server as listener for the traffic, we also define which group of…

  • F5 Lab 1.16: Virtual Server Order of Precedence

    F5 Lab 1.16: Virtual Server Order of Precedence

    There are always many virtual server configured on the F5, it can be configured as very specific source and destination…

  • F5 Lab 1.15: Persistence Profile- Cookie Persistence

    F5 Lab 1.15: Persistence Profile- Cookie Persistence

    On the last lab, I have done lab for persistence based on source and destination address. While on this article I will…

    1 条评论
  • F5 Lab 1.14: Persistence Profile-Source and Destination Address

    F5 Lab 1.14: Persistence Profile-Source and Destination Address

    Beside fallback host feature which I have tried on my last lab and article here, there is also other feature to stick…

  • F5 Lab 1.13: Fallback Host

    F5 Lab 1.13: Fallback Host

    As I mentioned on my last article here about configuring priority group activation, there is also an option to redirect…

  • F5 Lab 1.12: High Availability - Active/Active Configuration

    F5 Lab 1.12: High Availability - Active/Active Configuration

    As I mention on my last article here about high available options, F5 supports active/standby or active/active mode for…

    1 条评论

社区洞察

其他会员也浏览了