I ran into a frustrating issue where my KVM VMs would lose network connectivity if I installed docker on my Arch Linux system. After some digging I finally discovered the cause (thanks to anteru.net)
It turns out, docker adds a bunch of
iptables rules by default which prevent communication. These will interfere with an already existing bridge, and suddenly your VMs will report no network.
There are two ways to fix this. I went with the route of telling docker to NOT mess with iptables on startup. Less secure, but my system is not directly connected to the internet. I created /etc/docker/daemon.json and added this to it:
"iptables" : false
Then restarted my machine. This did the trick!
My cable internet has been horrid lately. I wanted to be able to hotspot to my phone while maintaining LAN connections to my servers while the cable company takes its sweet time to fix things. Even though I connected to wifi on my phone, my desktop still prioritized the broken connection and wouldn’t use my phone to get to the internet. I verified this by looking at the routing table and running traceroute
sudo ip route
default via 10.137.1.1 dev br0 proto dhcp src 10.10.1.124 metric 425
default via 18.104.22.168 dev wlp69s0 proto dhcp src 22.214.171.124 metric 600
traceroute google.com --max-hops=1
1 _gateway (10.10.50.1) 0.409 ms 0.449 ms 0.483 ms
The LAN connection’s default gateway had a lower metric than the mobile hotspot connection (lower takes precedence.) To fix this I ran this networkmanager command (thanks to this post for the inspiration)
sudo nmcli connection modify "Nicholas’s iPhone" ipv4.route-metric 50
I noticed DNS traffic was also prioritizing my LAN, which I didn’t want. I fixed it with nmcli as well (thanks to this post)
sudo nmcli connection modify "Nicholas’s iPhone" ipv4.dns-priority 1
I then noticed I couldn’t get to certain LAN subnets. I then realized I needed to add some static routes so they don’t try to go over my hotspot connection (which I learned about here)
sudo nmcli connection modify bridge-br0 +ipv4.routes "10.10.50.0/24 10.10.1.1"
Note you may need to refresh your connection once you’ve made changes. You can either disconnect and reconnect to force a refresh, or run this command (as outlined here.)
sudo nmcli con up bridge-br0 #or whatever your LAN interface name is
Once I refreshed my settings, I was able to get internet via my phone while maintaining all my local network settings.
I needed to add multiple domains to search DNS with on my Cent7 box. It turns out there are two ways to do it. Cent7 uses networkmanager, so you can use the cli tool to add what you want, or you can edit the file directly.
sudo nmcli con mod eth0 ipv4.dns-search "domain1.org,domain2.org,domain3.org"
This causes nmcli to add this line to your network interface config file (
/etc/sysconfig/network-scripts/ifcfg-eth0 in my case)
DOMAIN="domain1.org domain2.org domain3.org"
After either using nmcli or manually editing your file, simply restart the
network service and your search domains now work!
I’ve recently moved and needed to connect to my (still existing) home network from my desktop. I’ve never had to VPN from my desktop before, so here my notes for getting it working.
- Install necessary lt2p, pptp, and libreswan packages (I’m using yay as my package manager)
yay -Sy community/networkmanager-l2tp community/networkmanager-pptp aur/networkmanager-libreswan aur/libreswan
- Configure VPN in GNOME settings (close settings window first if it was already open)
- Add VPN / Layer 2 Tunneling Protocol (L2TP)
- Gateway: IP/DNS of VPN
- User Authentication: Type: password
- IPsec Settings: Type: Pre-shared Key (PSK)
- PPP settings: Only check MSCHAPv2, check everything else. MPPE Security: 128-bit (most secure)
If something isn’t working the popup is not very descriptive. Network manager logs are stored in journald, so the best way to troubleshoot is to follow the logs: (-f for follow, -u for unit name)
sudo journalctl -f -u NetworkManager
In my case following the networkmanager logs I could see I didn’t have libreswan fully installed, and installing the libreswan package fixed it.