After a boatload of challenges with what I thought would be my favorite Linux laptop, the Dell XPS 13 9343, I decided to take the plunge on a new Lenovo X1 Carbon (3rd gen). My late-2013 MacBook Pro Retina (MacbookPro11,1) had plenty of quirks when running Linux and I was eager to find a better platform.
There are some situations where you want to do the opposite of creating a wireless hotspot and you want to share a wireless connection to an ethernet connection. For example, if you’re at a hotel that offers only WiFi internet access, you could share that connection to an ethernet switch and plug in more devices. Also, you could get online with your wireless connection and create a small NAT network to test a network device without mangling your home network.
There are plenty of guides out there for making ethernet bridges in Linux to support virtual machines using built-in network scripts or NetworkManager. I decided to try my hand with creating a bridge using only systemd-networkd and it was surprisingly easy.
First off, you’ll need a version of systemd with networkd support. Fedora 20 and 21 will work just fine. RHEL/CentOS 7 and Arch Linux should also work. Much of the networkd support has been in systemd for quite a while, but if you’re looking for fancier network settings, like bonding, you’ll want at least systemd 216.
Getting our daemons in order
Before we get started, ensure that systemd-networkd will run on a reboot and NetworkManager is disabled. We also need to make a config file director for systemd-networkd if it doesn’t exist already. In addition, let’s enable the caching resolver and make a symlink to systemd’s
systemctl enable systemd-networkd systemctl disable NetworkManager systemctl enable systemd-resolved ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf mkdir /etc/systemd/network
Configure the physical network adapter
In my case, the network adapter connected to my external network is enp4s0 but yours will vary. Run
ip addr to get a list of your network cards. Let’s create
/etc/systemd/network/uplink.network and put the following in it:
[Match] Name=enp4s0 [Network] Bridge=br0
I’m telling systemd to look for a device called enp4s0 and then add it to a bridge called br0 that we haven’t configured yet. Be sure to change enp4s0 to match your ethernet card.
Make the bridge
We need to tell systemd about our new bridge network device and we also need to specify the IP configuration for it. We start by creating
/etc/systemd/network/br0.netdev to specify the device:
[NetDev] Name=br0 Kind=bridge
This file is fairly self-explanatory. We’re telling systemd that we want a device called br0 that functions as an ethernet bridge. Now create
/etc/systemd/network/br0.network to specify the IP configuration for the br0 interface:
[Match] Name=br0 [Network] DNS=192.168.250.1 Address=192.168.250.33/24 Gateway=192.168.250.1
This file tells systemd that we want to apply a simple static network configuration to br0 with a single IPv4 address. If you want to add additional DNS servers or IPv4/IPv6 addresses, just add more
Address lines right below the ones you see above. Yes, it’s just that easy.
Let’s do this
Some folks are brave enough to stop NetworkManager and start all of the systemd services here but I prefer to reboot so that everything comes up cleanly. That will also allow you to verify that future reboots will cause the server to come back online with the right configuration. After the reboot, run
networkctl and you’ll get something like this (with color):
Here’s what’s in the screenshot:
IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 enp2s0 ether off unmanaged 3 enp3s0 ether off unmanaged 4 enp4s0 ether degraded configured 5 enp5s0 ether off unmanaged 6 br0 ether routable configured 7 virbr0 ether no-carrier unmanaged 7 links listed.
My ethernet card has four ports and only enp4s0 is in use. It has a degraded status because there is no IP address assigned to enp4s0. You can ignore that for now but it would be nice to see this made more clear in a future systemd release.
Look at br0 and you’ll notice that it’s configured and routable. That’s the best status you can get for an interface. You’ll also see that my other ethernet devices are in the unmanaged state. I could easily add more
.network files to
/etc/systemd/network to configure those interfaces later.
As usual, the Arch Linux wiki page on systemd-networkd is a phenomenal resource. There’s a detailed overview of all of the available systemd-networkd configuration file options over at systemd’s documentation site.
Fedora 22 will be arriving soon and it’s easy to test on Rackspace’s cloud with my Ansible playbook:
As with the previous playbook I created for Fedora 21, this playbook will ensure your Fedora 21 instance is fully up to date and then perform the upgrade to Fedora 22.
WARNING: It’s best to use this playbook against a non-production system. Fedora 22 is an alpha release at the time of this post’s writing.
This playbook should work well against other servers and virtual machines from other providers but there are a few things that are Rackspace-specific cleanups that might not apply to other servers.
I do a bunch of Linux-related tasks daily. Some are difficult and others are easy. Printing has always been my nemesis.
Some printers offer up highly standardized methods for printing. For example, many HP printers simply work with JetDirect and PCL 5. However, the quirkier ones that require plenty of transformations before paper starts rolling can be tricky.
We have some Xerox ColorQube printers at the office and they require some proprietary software to get them printing under Linux. To get started, you’ll need a Linux printer driver for the Xerox ColorQube 9200 series.
Once you’ve downloaded the RPM (or DEB), install it:
sudo rpm -Uvh Xeroxv5Pkg-Linuxx86_64-5.15.551.3277.rpm
Start the Xerox Printer Manager:
Press the double down arrow button at the top (it’s the one on the left), and then press the button at the top right of the next window that looks like rectangles stacked on top of one another. Choose Manual Install from the menu that appears.
In the next menu, enter a nickname for the printer, the printer’s IP address, and select the correct printer model from the list. The printer should be properly configured in your CUPS system afterwards:
Any new print jobs set to the printer will cause the Xerox printer manager to pop up. This gives you the opportunity to customize your job (collating, stapling, etc) and you can also use secure print (which I highly recommend).