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 IP address to wildcarded source, destination IP and the port. When facing the configuration like that, F5 has order of precedence algorithm to decide which virtual server will be received the request.

On the virtual server we have options to configure:

  • Source Address: It can be specified as a host, network prefix or any
  • Destination Address: It can be specified as a host, network prefix or any
  • Service Port: It can be specified as a specific port or any

F5 will choose the VS from very specific to less specific configured of those three parameters. Starting from more specific destination IP, then look for more specific source IP and more specific port parameter.

For example there's a VS configured based on table below:

Figure 1 Example VS Configuration

Let's assume some cases:

  • Use case 1: Src Address 198.51.100.251 to 198.51.100.2 accessing HTTP
  • Use case 2: Src Address 198.51.100.4 to 198.51.100.2 accessing HTTP
  • Use case 3: Src Address 198.51.100.200 to 198.51.100.2 accessing HTTP
  • Use case 4: Src Address 192.0.2.2 to 198.51.100.2 accessing HTTP
  • Use case 5: Src Address 198.51.100.4 to 198.51.100.102 accessing HTTP
  • Use case 6: Src Address 198.51.100.251 to 198.51.100.2 accessing SSH
  • Use case 7: Src Address 192.0.2.2 to 198.51.102.1 accessing SSH

Let's prove the result on the lab by creating the virtual server and test the traffic based on each use cases:

1. Create all the virtual servers.

Figure 2 Virtual Server List

2. Prove each use cases by test the traffic and verify the statistic.

  • Use case 1: Src Address 198.51.100.251 to 198.51.100.2 accessing HTTP

Figure 3 Virtual Server Statistic Use Case 1

When traffic coming from 198.51.100.251 to 198.51.100.2 accessing HTTP it will be choose MARKETING_WEB_VS_6 because it has very specific configuration on source, destination and port.

  • Use case 2: Src Address 198.51.100.4 to 198.51.100.2 accessing HTTP

Figure 4 Virtual Server Statistic Use Case 2

When traffic coming from 198.51.100.4 to 198.51.100.2 accessing HTTP it will be choose MARKETING_WEB_VS_4 because it match the specific source IP prefix, destination and the port. Why it's not choosing MARKETING_WEB_VS_2 even tough the source IP of the client reside on both range source address prefixes. It because the source address configured on MARKETING_WEB_VS_4 is more specific compared to the MARKETING_WEB_VS_2. Prefix /29 is more specific than prefix /24. It's like longest-match on routing decision.

  • Use case 3: Src Address 198.51.100.200 to 198.51.100.2 accessing HTTP

Figure 5 Virtual Server Statistic Use Case 3

When traffic coming from 198.51.100.200 to 198.51.100.2 accessing HTTP it will be choose MARKETING_WEB_VS_2 because it match with the source IP prefix on /24, destination and the port.

  • Use case 4: Src Address 192.0.2.2 to 198.51.100.2 accessing HTTP

Figure 6 Virtual Server Statistic Use Case 4

When traffic coming from 192.0.2.2 to 198.51.100.2 accessing HTTP it will be choose MARKETING_WEB_VS because no more specific source address configured on other VS but the destination and the port are matched.

  • Use case 5: Src Address 198.51.100.4 to 198.51.100.102 accessing HTTP

Figure 7 Virtual Server Statistic Use Case 5

When traffic coming from 198.51.100.4 to 198.51.100.102 accessing HTTP it will be choose MARKETING_WEB_VS_3 because the destination IP matches with the configured prefix address (/24) and no more specific destination address configured on other VS.

  • Use case 6: Src Address 198.51.100.251 to 198.51.100.2 accessing SSH

Figure 8 Virtual Server Statistic Use Case 6

When traffic coming from 198.51.100.251 to 198.51.100.2 accessing SSH it will be choose MARKETING_WEB_VS_1 because the no more specific source and destination address configured on other VS but the port is matches.

  • Use case 7: Src Address 192.0.2.2 to 198.51.102.1 accessing SSH

Figure 9 Virtual Server Statistic Use Case 7

When traffic coming from 192.0.2.2 to 198.51.102.1 accessing SSH it will be dropped because the no match with the configured VS and no statistic counts on all VS.

Based on the test results of each use cases, it's recommended to plan and define the VS parameters (source address, destination address and service port) correctly to make the traffic directed to the correct virtual server and each backend server. By knowing the order of precedence, we know that unproperly configured parameters can cause unexpected traffic flow and it's not desired. You can explore more of other use cases on the attached link on the reference section.

Reference:

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

Deni Ramdani的更多文章

  • 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…

    8 条评论
  • 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.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 条评论

社区洞察

其他会员也浏览了