{"id":10709,"date":"2024-02-23T23:24:12","date_gmt":"2024-02-24T04:24:12","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=10709"},"modified":"2024-02-23T23:45:16","modified_gmt":"2024-02-24T04:45:16","slug":"fedora-39-load-balancing-across-two-network-connections","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=10709","title":{"rendered":"Fedora 39: Load Balancing Across Two Network Connections"},"content":{"rendered":"<p>I think this is one of those things that people don&#8217;t <em>normally<\/em> do at home, and the folks who configure this in enterprises know what they&#8217;re doing and don&#8217;t need guidance on how to do basic network things. But &#8230; we wanted to have two network cards in our server so high network traffic usage like backups and TV recording don&#8217;t create contention. When I was a server admin, I&#8217;d set up link aggregation &#8212; bonding, teaming &#8212; and it just magically worked. We&#8217;d put in a port request to get the new port turned up, note it was going to be a teamed interface, do our OS config, and everything was fine. What the network guys did? I had no idea. Well, now I do!<\/p>\n<p>On the switch &#8212; a Cisco 2960-S in this case &#8212; you need to create an EtherChannel and assign the ports to that channel. Telnet&#8217;ing to the switch, you first need to elevate your privileges as we start with level 1<\/p>\n<pre>wc2906s01&gt;show priv\r\nCurrent privilege level is 1<\/pre>\n<p>One you&#8217;ve entered privilege level 15, go into config term. Create the port-channel interface and assign it a number (I used 1, but 1 through 6 are options). Then go into each interface and add it to the port channel group you just created (again 1) &#8212; I set the mode to &#8220;on&#8221; because I doubt our server is going to negotiate PAgP and I didn&#8217;t want to get into setting up LACP.<\/p>\n<pre>enable 15\r\nconfig term\r\n\r\ninterface Port-channel 1\r\n\r\ninterface GigabitEthernet1\/0\/13\r\nchannel-group 1 mode on\r\n\r\ninterface GigabitEthernet1\/0\/14\r\nchannel-group 1 mode on\r\n\r\n# src-mac is the default, can change to something else\r\n# e.g. src-dst-mac would be set using\r\n# port-channel load-balance src-dst-mac\r\nend<\/pre>\n<p>Done! Using <tt>show etherchannel summary<\/tt> confirms that this worked:<\/p>\n<pre>wc2906s01&gt;show etherchannel summary\r\nFlags: D - down P - bundled in port-channel\r\nI - stand-alone s - suspended\r\nH - Hot-standby (LACP only)\r\nR - Layer3 S - Layer2\r\nU - in use f - failed to allocate aggregator\r\n\r\nM - not in use, minimum links not met\r\nu - unsuitable for bundling\r\nw - waiting to be aggregated\r\nd - default port\r\n\r\nNumber of channel-groups in use: 1\r\nNumber of aggregators: 1\r\n\r\nGroup Port-channel Protocol Ports\r\n------+-------------+-----------+-----------------------------------------------\r\n1 Po1(SU) - Gi1\/0\/13(P) Gi1\/0\/14(P)<\/pre>\n<p><em>Then<\/em> you can configure a network bond in Fedora and add the physical interfaces. Since we&#8217;re using KVM\/QEMU, there is a VMBridge bridge that contains the bond, and the bond joins two physical interfaces named enp10s2 and enp0s25<\/p>\n<p># VM Bridge configuration<\/p>\n<p>[lisa@fedora39 \/etc\/NetworkManager\/system-connections\/]# cat vmbridge.nmconnection<br \/>\n[connection]<br \/>\nid=vmbridge<br \/>\nuuid=b2bca190-827b-4aa4-a4f5-95752525e5e5<br \/>\ntype=bridge<br \/>\ninterface-name=vmbridge<br \/>\nmetered=2<br \/>\ntimestamp=1708742580<\/p>\n<p>[ethernet]<\/p>\n<p>[bridge]<br \/>\nmulticast-snooping=false<br \/>\npriority=1<br \/>\nstp=false<\/p>\n<p>[ipv4]<br \/>\naddress1=10.1.2.3\/24,10.5.5.1<br \/>\ndns=10.1.2.200;10.1.2.199;<br \/>\ndns-search=example.com;<br \/>\nmay-fail=false<br \/>\nmethod=manual<\/p>\n<p>[ipv6]<br \/>\naddr-gen-mode=stable-privacy<br \/>\nmethod=disabled<\/p>\n<p>[proxy]<\/p>\n<p>&nbsp;<\/p>\n<p># Bond configuration &#8212; master is the vmbridge, and the round robin load balancing option is used.<br \/>\n[lisa@fedora39 \/etc\/NetworkManager\/system-connections\/]# cat bond0.nmconnection<br \/>\n[connection]<br \/>\nid=bond0<br \/>\nuuid=15556a5e-55c5-4505-a5d5-a5c547b5155b<br \/>\ntype=bond<br \/>\ninterface-name=bond0<br \/>\nmaster=vmbridge<br \/>\nmetered=2<br \/>\nslave-type=bridge<br \/>\ntimestamp=1708742580<\/p>\n<p>[bond]<br \/>\ndowndelay=0<br \/>\nmiimon=1<br \/>\nmode=balance-rr<br \/>\nupdelay=0<\/p>\n<p>[bridge-port]<\/p>\n<p># Finally two network interfaces that are mastered by bond2<br \/>\n[lisa@fedora39 \/etc\/NetworkManager\/system-connections\/]# cat enp0s25.nmconnection<br \/>\n[connection]<br \/>\nid=enp0s25<br \/>\nuuid=159535a5-65e5-45f5-a505-a53555958525<br \/>\ntype=ethernet<br \/>\ninterface-name=enp0s25<br \/>\nmaster=bond0<br \/>\nmetered=2<br \/>\nslave-type=bond<br \/>\ntimestamp=1708733538<\/p>\n<p>[ethernet]<br \/>\nauto-negotiate=true<br \/>\nmac-address=55:65:D5:15:A5:25<br \/>\nwake-on-lan=32768<\/p>\n<p>[lisa@fedora39 \/etc\/NetworkManager\/system-connections\/]# cat enp10s2.nmconnection<br \/>\n[connection]<br \/>\nid=enp10s2<br \/>\nuuid=158525f5-f5d5-4515-9525-55e515c585b5<br \/>\ntype=ethernet<br \/>\ninterface-name=enp10s2<br \/>\nmaster=bond0<br \/>\nmetered=2<br \/>\nslave-type=bond<br \/>\ntimestamp=1708733538<\/p>\n<p>[ethernet]<br \/>\nauto-negotiate=true<br \/>\nmac-address=55:35:25:D5:45:B5<br \/>\nwake-on-lan=32768<\/p>\n<p>&nbsp;<\/p>\n<p>Restart NetworkManager to bring everything online. Voila &#8212; two network interfaces joined together and connected to the switch. Check out the bond file under \/proc\/net\/bonding to verify <em>this<\/em> side is working.<\/p>\n<p>[lisa@fedora39 ~\/]# cat \/proc\/net\/bonding\/bond0<br \/>\nEthernet Channel Bonding Driver: v6.7.5-200.fc39.x86_64<\/p>\n<p>Bonding Mode: load balancing (round-robin)<br \/>\nMII Status: up<br \/>\nMII Polling Interval (ms): 1<br \/>\nUp Delay (ms): 0<br \/>\nDown Delay (ms): 0<br \/>\nPeer Notification Delay (ms): 0<\/p>\n<p>Slave Interface: enp0s25<br \/>\nMII Status: up<br \/>\nSpeed: 1000 Mbps<br \/>\nDuplex: full<br \/>\nLink Failure Count: 2<br \/>\nPermanent HW addr: 55:65:d5:15:a5:25<br \/>\nSlave queue ID: 0<\/p>\n<p>Slave Interface: enp10s2<br \/>\nMII Status: up<br \/>\nSpeed: 1000 Mbps<br \/>\nDuplex: full<br \/>\nLink Failure Count: 0<br \/>\nPermanent HW addr: 55:35:35:d5:45:b5<br \/>\nSlave queue ID: 0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think this is one of those things that people don&#8217;t normally do at home, and the folks who configure this in enterprises know what they&#8217;re doing and don&#8217;t need guidance on how to do basic network things. But &#8230; we wanted to have two network cards in our server so high network traffic usage &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[1980,1706,1979,47,1978,1982,1195,1981],"class_list":["post-10709","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-bond","tag-cisco","tag-cisco-ios","tag-fedora","tag-ios","tag-link-aggregation","tag-redhat","tag-team"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10709"}],"version-history":[{"count":3,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10709\/revisions"}],"predecessor-version":[{"id":10713,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10709\/revisions\/10713"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}