Search This Blog

Showing posts with label vlan. Show all posts
Showing posts with label vlan. Show all posts

Wednesday, September 11, 2013

VLAN failsafe problem for F5 HA new builds

The F5 load balancers are powerful devices that support variety of high availability features. A full list  and description can be found at Configuring High Availability in TMOS Management Guide for BIG-IP Systems" document.

Supported HA features:

System fail-safe
Monitors the switch board component and a set of key system services.
Gateway fail-safe
Monitors traffic between the BIG-IP system and a gateway router.
VLAN fail-safe
Monitors traffic on a VLAN.
Problem

Both F5s in HA cluster fail over and go into standby mode when fail-safe is enabled on the VLAN that doesn't see any traffic.

Analysis and workaround descriptions

When you are building a new HA cluster this is not going to cause any major issues. Usually for new builds the cluster will be build without any servers behind the LTM devices. If both devices go into standby mode it may be surprising but a simple ping from one F5 to another should bring both them into standby/active again.

Unfortunately the issue can be experienced as well as in production when you are adding a new VLAN to a running HA cluster. If the VLAN has fail-safe enabled and if there are not devices behind both F5 LTMs the new VLAN may trigger the fail over on both nodes. As expected it is caused by the VLAN fail-safe when there is not traffic on the VLAN.

There are couple workarounds that can be applied, two examples are listed below.

Workaround 1

As per the SOL13297: Overview of VLAN failsafe (10.x - 11.x) set true to LTM data base variable failover.vlanfailsafe.resettimeronanyframe.
 
modify /sys db failover.vlanfailsafe.resettimeronanyframe value [true|false]

Workaround 2

Create a pool with all self IPs of the affected VLAN to allow the LTM to detect traffic on the new VLAN and to prevent fail-safe to kick in.

Monday, May 27, 2013

How does the VXLAN protocol work

The VXLAN is one of the overlay network tunneling protocols that is used to built network infrastructure for cloud environment. Below are some details about the operation and specification.
  • Frame headers definition

  • The traffic between VMs is encapsulated in IP/UDP packets
  • Logical isolation is implemented in a form of logical overlay where the traffic is exchanged between encryption tunnels endpoints
  • VXLAN ID is used to identify the specify isolated L2 cloud network that belongs to a tenant
  • The tunnel endpoints represent the edge of the cloud network infrastructure
  • The tunnel endpoints perform encapsulation and decapsulation
  • It is there where all the logic is implemented to find out where to sent next a packet or to witch VM the packet should be delivered after decapsulation



  • A comprehensive summary and operational features can be found under the links in reference section, below are few of the main characteristics and benefits:
    • It operates over IP and used UDP to carry payload 
    • Multicast support is the only other requirement for switches and routers to support VXLAN 
    • Multicast is used to handle L2 broadcast traffic (like ARP requests)
    • Logical networks can be extended among virtual machines placed in different Layer 2 domains
References
  1. http://www.definethecloud.net/vxlan-deep-dive
  2. http://www.definethecloud.net/vxlan-deep-divepart-2
  3. http://www.cisco.com/en/US/prod/collateral/switches/ps9441/ps9902/white_paper_c11-685115.html
  4. http://www.emulex.com/artifacts/d658610a-d3b6-457c-bf2d-bf8d476c6a98/elx_wp_all_VXLAN.pdf
  5. http://blogs.cisco.com/datacenter/more-vxlan-qa/
  6. http://blog.scottlowe.org/2011/12/07/revisiting-vxlan-and-layer-3-connectivity/
  7. http://blog.scottlowe.org/2011/12/22/otv-and-vxlan-layer-3-connectivity-compared/

Monday, April 1, 2013

How to configuring Linux interface so it can send and receive traffic with and without VLAN id in frames.

Often when deploying servers that are used as hypervisors you need to create VLANS on the software switch (on the hypervisor) as well as on the physical witches to isolate traffic between VMs running on different hypervisors.

There need to be as well a management network for the hypervisors itself. This should be isolated from the VM traffic of course.

Below is small example how a network diagram can look like for a setup with 2 hypervisors:
  • 1 FW for security control as well as to isolate and route between networks
  • 1 hypervisor cluster built out of 2 servers
  • 1 server in the inside segment
  • 1 server in the dmz segment
FW interface configuration:
FW# sh ip
System IP Addresses:
Interface                Name                   IP address      Subnet mask     Method
Ethernet0/0              outside                1.1.1.1         255.255.255.192 CONFIG
Ethernet0/1              inside                 192.168.100.1   255.255.255.0   manual
Ethernet0/2              dmz                    192.168.99.1    255.255.255.0   manual
Ethernet0/3              mgmt                   10.10.0.1       255.255.255.0   manual
Ethernet0/4.201          vm1                    172.168.1.1     255.255.255.0   manual
Ethernet0/4.202          vm2                    172.168.2.1     255.255.255.0   manual

The management network (10.10.0.0/24)
hyp1 host 10.10.0.2
hyp2 host  10.10.0.3
dmz host  10.10.0.4.
inside host  10.10.0.5

The inside network
inside host 192.168.100.5

The dmz network
dmz host  192.168.99.4

Relevant switch config (some details are not provided to keep it simple):

# sh run int Gi 0/1
interface FastEthernet0/1
 switchport trunk native vlan 300
 switchport trunk allowed vlan 300
 switchport trunk allowed vlan add 100,101,201,202
 switchport mode trunk
 speed 1000
 duplex full
 spanning-tree portfast
end

# sh run int Gi 0/2
 switchport trunk native vlan 300
 switchport trunk allowed vlan 300
 switchport trunk allowed vlan add 201,202,300
 speed 1000
 duplex full
 no cdp enable
 spanning-tree portfast

# sh run int Gi 0/3
 switchport access vlan 100
 switchport mode access
 speed 1000
 duplex full
 no cdp enable
 spanning-tree portfast

# sh run int Gi 0/4
 switchport access vlan 101
 switchport mode access
 speed 1000
 duplex full
 no cdp enable
 spanning-tree portfast

Problem

Each hypervisor have 2 physical interfaces only. Eth0 interface is used for the private VLAN communication. Eth1 should be used for management (VLAN 300) as well as for communication in the vm1 and vm2 networks. That way on a single physical interface we will manage 3 different networks: the untagged management and 2 tagged configured on the hypervisors to isolate traffic between VMs.

How to configure a Linux interface so it can sent and accept traffic with and without VLAN ID tags.

Analisis and results description

A default interface configuration in Linux doesn't use VLAN. From a switch perspective this interface operates in access mode. Once switch receives frames on such interface it uses its VLAN DB configuration to forward it to the next port.

# for the hyp1 server
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
IPADDR=10.10.0.2
NETMASK=255.255.255.0
NM_CONTROLLED="yes"
ONBOOT="yes"

Base on our switch config above interface Gi 0/2 is configured as trunk with a native VLAN id 300. That means that all incoming frames without VLAN id will be classified and assign to VLAN 300. That way the servers and FW are able to communicate using the IP addresses 10.10.0.0/24 and don't worry about any VLAN tagging at all.

To instruct Linux to sent Ethernet frames that include VLAN id we need to configure following subinterfaces.

# for the hyp1 server

# cat ifcfg-eth1.201
DEVICE=eth0.201
BOOTPROTO=static
ONBOOT=yes
IPADDR=172.168.1.2
NETMASK=255.255.255.0
VLAN=yes

# cat ifcfg-eth1.202
DEVICE=eth0.202
BOOTPROTO=static
ONBOOT=yes
IPADDR=172.168.2.2
NETMASK=255.255.255.0
VLAN=yes

Now when Linux needs to communicate within 172.168.1.0/24 or 172.168.2.0/24 network it uses one of the appropriate interfaces above. All  ethernet frames will be encapsulated using 802.1q standard  The switch will see an ingress traffic encapsulated in 802.1q with VLAN and according to its trunk config it will decapsulation it and distribute it in the right VLAN or drop.

In other words, traffic will traverse down to the switch port Gi 0/2 and base on the trunk configuration the switch should accept it (it will be discarded if the vlan ID doesn't match 20X). Accepted frames will follow standard path inside switch and after CAM table lookup they will be forwarded to next port on the same VLAN base on the destination MAC address.

References
  1. https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces_802.1q-vlan-tagging.html
  2. https://learningnetwork.cisco.com/thread/8721