{"id":99,"date":"2020-08-01T17:21:48","date_gmt":"2020-08-01T09:21:48","guid":{"rendered":"https:\/\/blog.swineson.me\/en\/?p=99"},"modified":"2020-10-24T18:12:09","modified_gmt":"2020-10-24T10:12:09","slug":"multicast-vxlan-for-routers","status":"publish","type":"post","link":"https:\/\/blog.swineson.me\/en\/multicast-vxlan-for-routers\/","title":{"rendered":"Multicast VXLAN for Routers"},"content":{"rendered":"<p>VXLAN has been around for a while, so how do router vendors support it? Well, let&#8217;s use a dead simple topology to test them out.<\/p>\n<p>Our setup today:<\/p>\n<ul>\n<li>All routers connected to the same dumb switch using IP range 169.254.0.0\/24<\/li>\n<li>Multicast signaling on address 239.0.0.1, No PIM<\/li>\n<li>VXLAN UDP port 4789<\/li>\n<li>Network 10.0.0.0\/24 on VNI 5000 (layer 3 termination \/ inter-VXLAN routing)<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h1>Generic Linux<\/h1>\n<p>Tested version: Debian 10, Linux kernel 4.19.0<\/p>\n<p>Linux runs just fine with the most simple setup across all operating systems we tested. VXLAN VTEP is implemented as a layer 2 tunnel device which means you can either put it into a bridge or just assign IPs to it.<\/p>\n<pre class=\"lang:sh decode:true\">ip link set ens3 up\r\nip addr add 169.254.0.1\/24 dev ens3\r\nip -6 link add vxlan1 type vxlan id 5000 dstport 4789 local 169.254.0.1 group 239.0.0.1 dev ens3 ttl 1\r\nip link set vxlan1 up\r\nip addr add 10.0.0.1\/24 dev vxlan1<\/pre>\n<p>Notes:<\/p>\n<ul>\n<li>Support IPv6 underlay (yes!)<\/li>\n<li>UDP port is 8472 by default<\/li>\n<li>TTL is 1 by default<\/li>\n<\/ul>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/vincent.bernat.ch\/en\/blog\/2017-vxlan-linux\" target=\"_blank\" rel=\"noopener noreferrer\">VXLAN &amp; Linux<\/a><\/li>\n<li><a href=\"https:\/\/vincent.bernat.ch\/en\/blog\/2017-vxlan-bgp-evpn\" target=\"_blank\" rel=\"noopener noreferrer\">VXLAN: BGP EVPN with Cumulus Quagga (or FRR)<\/a><\/li>\n<\/ul>\n<h1>VyOS<\/h1>\n<p>Tested version: 1.2.5, Linux kernel 4.19.106<\/p>\n<p>VyOS is basically Linux with a better config interface, so there isn&#8217;t much difference.<\/p>\n<pre class=\"lang:default decode:true \">set interfaces ethernet eth0 address 169.254.0.5\/24\r\nset interfaces vxlan vxlan1 address 10.0.0.5\/24\r\nset interfaces vxlan vxlan1 group 239.0.0.1\r\nset interfaces vxlan vxlan1 link eth0\r\nset interfaces vxlan vxlan1 remote-port 4789\r\nset interfaces vxlan vxlan1 vni 5000\r\n<\/pre>\n<p>Notes:<\/p>\n<ul>\n<li>UDP port is 8472 by default<\/li>\n<li>If you forget to set the remote-port on interface creation, you have to delete the interface, commit, create the interface again<\/li>\n<\/ul>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.vyos.io\/en\/latest\/interfaces\/vxlan.html\" target=\"_blank\" rel=\"noopener noreferrer\">VXLAN<\/a><\/li>\n<\/ul>\n<h1>Cisco IOS XE<\/h1>\n<p>Tested version: 16.12.3<\/p>\n<p>IOS XE&#8217;s command line user experience and internal design is a mess, and the documentation is bad in many aspects. IOS XE does not support running layer 3 over a VXLAN VTEP (yes, it self identifies as a router) so here&#8217;s a config for bridging the VTEP with an ethernet port.<\/p>\n<pre class=\"lang:default decode:true \">ip multicast-routing distributed\r\ninterface GigabitEthernet1\r\n no shutdown\r\n ip address 169.254.0.2 255.255.255.0\r\ninterface GigabitEthernet2\r\n no shutdown\r\n service instance 1 ethernet\r\ninterface nve1\r\n no shutdown\r\n source-interface GigabitEthernet1\r\n vxlan udp port 4789\r\n member vni 5000 mcast-group 239.0.0.1\r\nbridge-domain 1\r\n member vni 5000\r\n member GigabitEthernet2 service-instance 1<\/pre>\n<p>To bridge the VTEP with a tagged VLAN on an ethernet port, you can&#8217;t just create a VLAN subinterface and bridge it. Instead, you need a service instance like this:<\/p>\n<pre class=\"lang:default decode:true\">interface GigabitEthernet2\r\n service-instance interface 100 ethernet\r\n  bridge-domain 100\r\n  encapsulation dot1q 100\r\n  rewrite ingress tag pop 1 symmetric<\/pre>\n<p>Notes:<\/p>\n<ul>\n<li>All Cisco documentation write VXLAN as &#8220;VxLAN&#8221; which is not correct and triggers my OCD<\/li>\n<li>You can only use VNI 4096-16777215 (obviously a result of bad software engineering)<\/li>\n<li>IPv6 multicast group for underlay network is not supported<\/li>\n<li>You can&#8217;t configure IP\/IPv6 address on NVE interface<\/li>\n<li>No inter-VXLAN routing, and adding BVI\/BDI\/Loopback to the bridge domain won&#8217;t work<\/li>\n<li>One device supports 8000 bridge domains at most<\/li>\n<li>IOS XE for catalyst switches does not support multicast VXLAN but support inter-VXLAN routing<\/li>\n<\/ul>\n<p>Also I noticed that there will be a Tunnel interface automatically configured for every NVE interface, the tunnel interface will copy the IP address from NVE&#8217;s source interface.<\/p>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.cisco.com\/c\/en\/us\/td\/docs\/routers\/csr1000\/software\/vxlan\/m_csr-vxlan-support-book.html\" target=\"_blank\" rel=\"noopener noreferrer\">Cisco CSR 1000V VxLAN Support<\/a><\/li>\n<\/ul>\n<h1>Cisco ASA<\/h1>\n<p>Tested version: 9.10.1<\/p>\n<p>In my past experience, ASAs are little devices with some odd personalities that I had a hard time getting used to. However configuring VXLAN on the ASA turned out to be very simple.<\/p>\n<pre class=\"lang:default decode:true \">vxlan port 4789\r\ninterface GigabitEthernet0\/0\r\n no shutdown\r\n nameif outside\r\n security-level 0\r\n ip address 169.254.0.3 255.255.255.0\r\ninterface vni5000\r\n no shutdown\r\n segment-id 5000\r\n nameif inside\r\n security-level 100\r\n ip address 10.0.0.3 255.255.255.0\r\n vtep-nve 1\r\nnve 1\r\n encapsulation vxlan\r\n source-interface outside\r\n default-mcast-group 239.0.0.1<\/pre>\n<p>Notes:<\/p>\n<ul>\n<li>Smart license means $$$<\/li>\n<li>IPv6 multicast group for underlay network is not supported<\/li>\n<li>No PBR support (and a lot of other protocols\/features, but routing on ASA has always been weird so I&#8217;d not bother mentioning them)<\/li>\n<li>Only 1 NVE instance per context for now<\/li>\n<li>You can have only 10000 VNI interfaces per context<\/li>\n<li>To make a physical interface only able to accept VXLAN traffic, you can use the <span class=\"lang:default highlight:0 decode:true crayon-inline \">nve-only<\/span> command<\/li>\n<\/ul>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.cisco.com\/c\/en\/us\/td\/docs\/security\/asa\/asa94\/config-guides\/cli\/general\/asa-94-general-config\/interface-vxlan.html\" target=\"_blank\" rel=\"noopener noreferrer\">CLI Book 1: Cisco ASA Series General Operations CLI Configuration Guide, 9.4<\/a><\/li>\n<\/ul>\n<h1>Junos OS for Juniper EX\/QFX\/MX<\/h1>\n<p>Juniper like to overdesign everything. Their design is sometimes very useful, but make network designing complicated.<\/p>\n<p>Configuration for vQFX:<\/p>\n<pre class=\"lang:default decode:true\">set interfaces xe-0\/0\/0 unit 0 family inet address 169.254.0.7\/24\r\nset interfaces irb unit 5000 family inet address 10.0.0.7\/24\r\nset interfaces lo0 unit 0 family inet address 169.254.0.7\/24\r\nset switch-options vtep-source-interface lo0.0\r\nset vlans VXLAN1 vlan-id 100\r\nset vlans VXLAN1 l3-interface irb.5000\r\nset vlans VXLAN1 vxlan vni 5000\r\nset vlans VXLAN1 vxlan multicast-group 239.0.0.1\r\n<\/pre>\n<p>Notes:<\/p>\n<ul>\n<li>Junos OS must use an IP configured on the loopback interface as the VTEP source IP address<\/li>\n<li>Only one interface on a device can receive and parse VXLAN packets<\/li>\n<li>IPv6 multicast group for underlay network is not supported<\/li>\n<li>If you need to run inter-VXLAN routing, you need to configure <span class=\"lang:default highlight:0 decode:true crayon-inline \">irb-interface<\/span> on the vlan interface, and you must configure a <span class=\"lang:default highlight:0 decode:true crayon-inline \">vlan-id<\/span> for every <span class=\"lang:default highlight:0 decode:true crayon-inline \">irb-interface<\/span> enabled vlan interface, which limits the available vlan interface count to 4092<\/li>\n<li>Why 4092? because don&#8217;t use vlan-id 1 and 2 on the VXLAN vlan interface, these are cursed numbers<\/li>\n<li>The ability to run inter-VXLAN routing differs from device to device<\/li>\n<li>SRX devices do not support VXLAN<\/li>\n<li>If you are using vQFX for lab purposes, please use version 15.1X53-D60.4; other versions (no matter higher or lower) have problems on VXLAN, RSVP, EoMPLS (l2circuit), etc.<\/li>\n<\/ul>\n<p>References:<\/p>\n<ul>\n<li><a href=\"https:\/\/jncie.tech\/2017\/07\/15\/vxlan-multicast\/\" target=\"_blank\" rel=\"noopener noreferrer\">VXLAN MULTICAST<\/a><\/li>\n<li><a href=\"https:\/\/www.juniper.net\/documentation\/en_US\/junos\/topics\/topic-map\/vxlan-qfx-series.html\" target=\"_blank\" rel=\"noopener noreferrer\">Examples: Manually Configuring VXLANs on QFX Series and EX4600 Switches<\/a><\/li>\n<li><a href=\"https:\/\/www.juniper.net\/documentation\/en_US\/junos\/topics\/concept\/vxlan-constraints-qfx-series.html\" target=\"_blank\" rel=\"noopener noreferrer\">VXLAN Constraints on QFX Series and EX Series Switches<\/a><\/li>\n<\/ul>\n<h1>MikroTik RouterOS<\/h1>\n<p>Tested version: 7.1 beta 1<\/p>\n<p>RouterOS is the latest one to support VXLAN and the support is limited to their cutting-edge development version. But let&#8217;s try it out, shall we?<\/p>\n<p>The config is as simple as Linux. (Well, I guess they are using the stock Linux implementation of VXLAN tunnel.) I&#8217;m using the new slash\/seperated\/config\/grammar here.<\/p>\n<pre class=\"lang:default decode:true\">\/ip\/address\/add address=169.254.0.6\/24 interface=ether1\r\n\/interface\/vxlan\/add name=vxlan1 interface=ether1 group=239.0.0.1 mtu=1450 port=4789 vni=5000\r\n\/ip\/address\/add interface=vxlan1 address=10.0.0.6\/24<\/pre>\n<p>Notes:<\/p>\n<ul>\n<li>UDP port is 8472 by default<\/li>\n<li>You must set a MTU for VXLAN interface because the default value 1500 is not going to work (for an underlay network with MTU 1500, the VXLAN MTU is 1450)<\/li>\n<\/ul>\n<h1>Conclusion<\/h1>\n<p>Although BGP EVPN is the future, unicast\/multicast EVPN is still handy for small-scale, autonomous deployments without a dedicated controller or something. Enterprise solutions tend to overlook the simple needs and require a lot just to make everything work. Also enterprise solutions tend to have very bad software quality. On the contrary, Linux implements VXLAN in a simple and elegant way, but its inability to atomically save and restore network config added some management overhead to the operation guys.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VXLAN has been around for a while, so how do router vendors support it? Well, let&#8217;s use a dead simple topology to test them out. Our setup today: All routers connected to the same dumb switch using IP range 169.254.0.0\/24 Multicast signaling on address 239.0.0.1, No PIM VXLAN UDP port 4789 Network 10.0.0.0\/24 on VNI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-networking"],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts\/99"}],"collection":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":13,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts\/99\/revisions\/172"}],"wp:attachment":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}