As an expert-level Linux operating system tailored for general desktop and development use, Manjaro offers advanced users extensive control over system configuration. This includes granular control of the critical networking components that facilitate communication both within Manjaro itself as well as outward to connect Manjaro to local networks and the internet.

The core components that enable this communication are network interfaces. Sometimes called network interface controllers (NICs), these represent the system‘s physical wired and wireless data links. Common examples are Ethernet ports or Wi-Fi antenna modules. At a software level, network interfaces handle addressing, send/receive capabilities, and pass data to/from the network services running on Manjaro.

Understanding how to properly control interface configuration provides tremendous benefits for a Manjaro expert. Selectively enabling or disabling interfaces facilitates network troubleshooting, optimizes security, allows power savings, permits interface renaming, and more. Interfaces serve as gatekeepers for all network connectivity, so learning best practices for interface management should be a priority for any advanced user or administrator.

In this comprehensive guide, we will cover:

  • Methods for collecting interface information in Manjaro
  • Core interface control with ip link and ifconfig
  • Using NetworkManager connections with nmcli
  • Stopping services with systemctl
  • An interactive UI option via nmtui
  • Automating changes with scripts
  • Advanced troubleshooting tactics
  • Improving Linux network security posture

Follow along for expert-level insight into maximizing control over Manjaro‘s network interfaces to improve stability, security posture, and savings.

A Technical Deep Dive on Manjaro‘s Network Links

Before changing interface settings, let‘s explore technically how Manjaro leverages interfaces for communication. This will provide helpful context and core knowledge.

At the lowest level, a network interface controller connects Manjaro to a physical wired or wireless medium. This allows the encoding of data into signals for transmission, as well receiving incoming signals to decode data.

Here are some typical physical network examples in a Manjaro environment:

Physical Medium Interface Type Example Hardware Device
Twisted pair cabling Wired Ethernet Intel I225 controller
Wi-Fi radio waves Wireless 802.11 Qualcomm Atheros module
Bluetooth radio Wireless Personal Area Network Broadcom BCM43142

The interface handles modulation/demodulation, assigns unique MAC addresses for identification, and transfers byte streams to/from the operating system kernel. This enables networking without Manjaro software needing to understand the nuances of specific hardware or mediums.

Within Manjaro itself, the kernel manages interfaces as software devices akin to /dev/sda disks. Routing tables then dictate where packets flow, firewall rules control access, and network services like DHCP or DNS coordinate additional capabilities. Common userspace network tools in Manjaro include:

  • iproute2: Implements routing, interfaces, and network infrastructure.
  • NetworkManager: Central configuration and connectivity service.
  • systemd-networkd: Lower level network setup daemon.

Proper kernel routing ensures packets find their way between interfaces. For example routing traffic from the wired Ethernet controller out through an active Wi-Fi connection to reach the internet. Sophisticated queuing and shaping maintains performance.

Finally at the user level, common Manjaro tools like Firefox or Steam only need to open TCP sockets or UDP ports to leverage the complex underlying network infrastructure for their traffic.

This full stack integration allows rich services in spite of limited hardware capabilities. But it depends entirely on the smart configuration of interfaces to make appropriate lower level network mediums available to Manjaro itself.

Now that you understand technically what interfaces facilitate within Manjaro, let‘s explore the tools and techniques available for controlling them.

Listing Available Manjaro Network Interfaces

The first step to administering interfaces is enumerating what Manjaro currently has available. Gathering active links along with their assigned IP addresses reduces confusion when selecting a target for status changes.

The most flexible tool is the iproute2 networking suite, specifically the ip addr and ip -s link variants. For simple listings of addresses try:

ip a
# or
ip addr

And for interface specific status details:

ip -s link

Example output could resemble:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 24:6e:96:3f:77:18 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.5/24 brd 10.0.0.255 scope global dynamic wlp1s0
       valid_lft 3049sec preferred_lft 3049sec
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 02:42:41:78:0d:5c brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

This shows the loopback lo, Wi-Fi wlp1s0, and a Docker bridge interface. Only lo and Wi-Fi have active connections but all are currently enabled.

For simpler, classic output you can install net-tools and run:

sudo pacman -S net-tools

ifconfig

Overall best practice is checking both ip link and ifconfig when inspecting initial interface state before considering any status changes or troubleshooting.

Now let‘s explore helpful commands for safely changing the status of your desired target interface.

Toggling Interface State with ip and ifconfig

The main methods for dynamically controlling interface state are the venerable ifconfig tool along with the more modern iproute2 toolset. Specifically ifconfig for simplistic up/down commands or ip link when you need additional options.

ifconfig for quick enable/disable

The ifconfig tool predates advanced Linux capabilities but still offers an easy way to toggle basic interface status with:

sudo ifconfig wlp1s0 down
sudo ifconfig docker0 up 

This acts as an on/off switch. Verify by checking ifconfig again:


wlp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 24:6e:96:3f:77:18  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:41:78:0d:5c  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

With Wi-Fi disabled but Docker enabled. Simple, but lacking flexibility.

ip link for advanced control

For setting additional options like renaming devices or adjusting MAC addresses, instead leverage iproute2‘s ip command, specifically:

sudo ip link set dev wlp1s0 down
sudo ip link set dev docker0 name br101

The updated name parameter alters how Manjaro sees the interface. Verify via:

ip -s link show br101

Give focus and practice to mastering both the basics of ifconfig up/down toggling as well as more advanced ip link dev controls. This unlocks interface administration capabilities.

Next let‘s explore manipulating connections at the network profile level via NetworkManager.

NetworkManager Profiles: nmcli/nmtui

NetworkManager is the system service that oversees interface connections on Manjaro. It manages profiles that associate low level interfaces like wlp1s0 to higher levelnamed connections like MyWireless complete with DNS settings and security credentials.

Advanced users can utilize NetworkManager‘s command line client nmcli or text UI nmtui for additional control options.

nmcli

The nmcli tool talks directly to NetworkManager allowing visibility of what connection profiles are active or disabled:

nmcli connection show --active

And name based control for stopping, starting, or restarting wired, wireless, VPN, and other links:

sudo nmcli connection down "My Wireless"
sudo nmcli connection up "My Wired Profile"

This keeps DNS, gateway, and credentials configured in NetworkManager profiles while toggling connectivity.

nmtui

For interactive usage the nmtui tool launches an application allowing you to see profiles, activate/deactivate connections, edit settings, and additional options via arrow key navigation and enter selection.

sudo nmtui

With no command line, nmtui offers a friendlier introduction to NetworkManager control vs learning nmcli arguments.

Utilize these NetworkManager tools in conjunction with ip/ifconfig link manipulation for redundant control across interface layers.

Controlling Network Services with systemctl

At a foundational level, network functionality relies entirely on system services like NetworkManager or systemd-network running properly. Advanced users can stop, restart, or disable these controlling processes for maximum control.

The systemctl management tool allows service queries along with stop, start, restart, and disable operations.

Check status first:

sudo systemctl status NetworkManager
● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-12-19 11:11:12 EST; 14min ago
       Docs: man:NetworkManager(8)
 Main PID: 570 (NetworkManager)
    Tasks: 3 (limit: 19036)
       Memory: 31.5M
       CGroup: /system.slice/NetworkManager.service
               └─570 /usr/bin/NetworkManager --no-daemon

Dec 19 11:11:12 manjaro NetworkManager[570]: <info>  [1671498672.5163] manager: (enp2s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/8)
Dec 19 11:11:12 manjaro NetworkManager[570]: <info>  [1671498672.5178] manager: (enp2s0): exported as /org/freedesktop/NetworkManager/Devices/2
Dec 19 11:11:12 manjaro NetworkManager[570]: <info>  [1671498672.5185] device (enp2s0): state change: unmanaged -> unavailable (reason ‘managed‘, sys-iface-state: ‘external‘)
Dec 19 11:11:12 manjaro NetworkManager[570]: <info>  [1671498672.5615] device (wlp3s0): carrier: link connected

Then stop with -qq for no prompts plus errors only:

sudo systemctl stop -qq NetworkManager

And restart/enable as needed:

sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager

This allows resetting all network coordinator services as part of troubleshooting or experiments without fully rebooting Manjaro.

Combining systemctl, NetworkManager profiles, and ip commands provides avenues for network control across all tiers.

Automating Interface Administration

Master Manjaro networking experts automate common tasks by collecting commands into reusable scripts. This facilitates one-touch network administration.

For example, create network-reset.sh:

#!/bin/bash

# Reset all NetworkManager profiles
sudo nmcli connection down "*"
sudo nmcli connection up "*"   

# Disable then re-enable eth0 link  
sudo ifconfig eth0 down
sudo ifconfig eth0 up

# Rename wlan0 
sudo ip link set dev wlan0 name w0  

# Restart network manager
sudo systemctl restart NetworkManager 

Now run at any time with:

./network-reset.sh

Additional examples include toggling Wi-Fi when a wired connection is activated to save power, or swapping which GPU handles high performance networking.

Build customized scripts to codify and automate your frequent network administration tasks.

Key Network Troubleshooting Strategies

Managing interface status plays a major role in resolving network issues:

Slow File Transfers: Disable Wi-Fi or unused secondary NICs during large downloads/uploads:

sudo ifconfig wlp1s0 down  

Web Browsing Failures: Restart NetworkManager and reboot associated adapters:

sudo systemctl restart NetworkManager
sudo ifconfig enp2s0 down; ifconfig enp2s0 up

Name Resolution Problems: Temporarily set static DNS on desired interfaces:

nmcli connection modify enp2s0 ipv4.dns "1.1.1.1 1.0.0.1"

VPN Connection Issues: Toggle problematic links up/down to force renegotiation:

sudo ip link set tun0 down; ip link set tun0 up

Docker Networking Problems: Rename container links away from defaults:

sudo ip link set dev docker0 down
sudo ip link set dev docker0 name dockernet
sudo ip link set dev dockernet up

Don‘t hesitate to liberally utilize ifconfig, ip link, nmcli, and systemctl restarts to isolate and resolve network issues through interface and NetworkManager cycling.

Auditing and Hardening Security

From an administrative perspective, excessive interfaces with public connectivity often weaken security posture:

  • Unnecessary hardware expands the attack surface vulnerable to exploits
  • Power users create software interfaces lacking scrutiny
  • Stale DHCP leases allow residual access after devices disconnect

Manjaro experts periodically audit risky network landscape status with:

sudo nmap -sU -sS -O localhost
sudo arp -a -n  
ip neighbor show nud all

This maps open ports, connected peers, and where application traffic flows.

Then improve the situation via configure firewall policies that block unused interface access, establish static ARP bindings, deactivate wireless when not needed, and other hardening steps.

Monitor interface usage with Netflow collection:

sudo apt install nfdump && nfdump -l

This spotlights heavy hitters to inform isolation candidates.

Avoid temptation to power up connectivity without purpose. Simplify interface availability and keep the minimum necessary links active to harden workloads.

Conclusion

Interface configuration sits at the heart of Linux networking. Mastering control mechanisms for enabling, disabling, troubleshooting, and securing Manjaro‘s logical and physical network links provides tremendous value.

Follow an escalating strategy:

  1. Enumerate available interfaces with ip and ifconfig.
  2. Toggle base status with ip link or simple ifconfig.
  3. Manage NetworkManager profiles using nmcli or friendly nmtui.
  4. Restart NetworkManager itself via systemctl.
  5. Automate repetitive tasks in scripts!

From troubleshooting odd behavior to optimizing performance and security – don‘t leave interface administration solely to automatic tools. Channel your inner network expert by manually managing interface state like a pro.

Smoothly functioning connectivity empowers applications and workflow across the broader Manjaro operating system. Take time to perfect your interface administration skills on this foundational level to better support userspace services and stay resilient trouble spots arise.

The tools highlighted here should build lasting capabilities Manjaro power users can carry to any Linux environment. Setup a test workspace, practice interface control mechanics, learn by doing, and become the interface expert you team depends on!

Similar Posts