Tag: networkmanager

  • How to Check and Enable Wake-on-LAN on Fedora

    How to Check and Enable Wake-on-LAN on Fedora

    Wake-on-LAN (WOL) allows you to power on a Fedora computer remotely by sending a specially formatted “magic packet” over the network. It is useful for remotely accessing a home server, desktop, or media center without leaving the machine running continuously.

    This guide explains how to check whether your network adapter supports WOL, enable it, make the setting persistent, and test that it works.

    Check the Network Interface

    First, identify your wired network interface:

    ip link

    In this example, the interface is named enp3s0.

    Run ethtool to inspect its capabilities:

    ethtool enp3s0

    If you see an error such as:

    netlink error: Operation not permitted

    run the command with sudo:

    sudo ethtool enp3s0

    The interface should also report an active network connection:

    Link detected: yes

    This confirms that the Ethernet connection itself is working.

    Check Wake-on-LAN Support

    Look for these two lines in the output:

    Supports Wake-on: pumbg
    Wake-on: d

    The Supports Wake-on line shows which wake-up methods the network adapter supports. The letter g represents wake-up using a magic packet.

    The Wake-on line shows the current configuration:

    • Wake-on: g — magic-packet WOL is enabled
    • Wake-on: d — WOL is disabled
    • Supports Wake-on: ...g... — the adapter supports magic-packet WOL

    In this example, the adapter supports WOL, but it is currently disabled.

    Enable Wake-on-LAN Temporarily

    Enable magic-packet wake-up with:

    sudo ethtool -s enp3s0 wol g

    Verify the setting:

    sudo ethtool enp3s0 | grep -i wake

    The expected output is:

    Supports Wake-on: pumbg
    Wake-on: g

    This setting may be lost after reboot or when the network connection is restarted, so configure it persistently if you plan to use WOL regularly.

    Make the Setting Persistent

    Fedora commonly manages network connections through NetworkManager. List the available connections:

    nmcli connection show

    Identify the wired connection associated with enp3s0. Then configure it to use magic-packet Wake-on-LAN:

    sudo nmcli connection modify "CONNECTION_NAME" 802-3-ethernet.wake-on-lan magic

    Replace CONNECTION_NAME with the actual connection name shown by nmcli.

    For example:

    sudo nmcli connection modify "Wired connection 1" 802-3-ethernet.wake-on-lan magic

    Reactivate the connection:

    sudo nmcli connection up "CONNECTION_NAME"

    Finally, verify the configuration:

    sudo ethtool enp3s0 | grep -i wake

    You should see:

    Wake-on: g

    Find the Computer’s MAC Address

    A Wake-on-LAN packet must be sent to the computer’s network adapter MAC address. Display it with:

    ip link show enp3s0

    Look for a line similar to:

    link/ether 00:11:22:33:44:55

    The value after link/ether is the MAC address you will use when sending the magic packet.

    Test Wake-on-LAN

    Before testing, shut down the Fedora computer:

    systemctl poweroff

    From another computer or mobile device on the same local network, send a Wake-on-LAN magic packet to the Fedora machine’s MAC address.

    If the computer powers on, Wake-on-LAN is working correctly.

    The sending device may require:

    • The target MAC address
    • The local broadcast address, often something like 192.168.1.255
    • UDP port 9 or 7

    The exact procedure depends on the operating system or WOL application you use.

    Troubleshooting

    If the computer does not wake, check the following:

    1. Confirm WOL is enabled before shutdown: sudo ethtool enp3s0 | grep -i wakeThe output should include: Wake-on: g
    2. Enable WOL in the BIOS or UEFI.
      Look for settings named:
      • Wake on LAN
      • Power On by PCI-E
      • Resume by LAN
      • PCIe Device Power On
    3. Use a wired Ethernet connection.
      Wake-on-LAN is generally more reliable over Ethernet than Wi-Fi.
    4. Keep the Ethernet cable connected.
      The network adapter must remain powered while the computer is off.
    5. Check power-saving settings.
      Options such as ErP, Deep Sleep, or EuP may remove power from the network adapter during shutdown. Disable them if necessary.
    6. Make sure the packet is sent from the same network.
      Basic WOL testing is easiest when both devices are connected to the same LAN.

    Summary

    To check and enable Wake-on-LAN on Fedora:

    sudo ethtool enp3s0
    sudo ethtool -s enp3s0 wol g
    sudo ethtool enp3s0 | grep -i wake

    A successful configuration reports:

    Supports Wake-on: pumbg
    Wake-on: g

    The adapter in this example supports Wake-on-LAN, and enabling wol g activates magic-packet wake-up. For reliable use after reboots, configure the setting through NetworkManager and verify that WOL is also enabled in the system’s BIOS or UEFI.

  • Ubuntu Linux Cheatsheet

    Ubuntu Linux Cheatsheet

    The world’s most popular desktop & server Linux
    Uses apt (Debian-based). All privileged commands require sudo.
    Covers Ubuntu Desktop, Server, LTS, and Snaps.


    1. Installation (Live USB / Server ISO)

    TaskCommand / Action
    Boot Live USBTry Ubuntu → Install Ubuntu
    Disk setupUse Eraser or Something Else (manual: /, /boot, swap)
    Server installBoot ISO → Language → Minimal or Standard
    Enable SSH (server)sudo apt install openssh-server
    Update on first bootsudo apt update && sudo apt upgrade -y

    2. APT (Package Management)

    ActionCommand
    Update package listssudo apt update
    Upgrade all packagessudo apt upgrade -y
    Full upgrade (new deps)sudo apt full-upgrade -y
    Install packagesudo apt install package
    Remove packagesudo apt remove package
    Purge (with config)sudo apt purge package
    Autoremove unusedsudo apt autoremove
    Clean cachesudo apt clean
    Search packageapt search keyword
    List installeddpkg -l | grep ^ii
    Show infoapt show package
    Fix broken installssudo apt install -f
    Which package owns filedpkg -S /path/to/file

    3. Snaps (Universal Packages)

    ActionCommand
    Install snapsudo snap install package
    Update all snapssudo snap refresh
    List installedsnap list
    Remove snapsudo snap remove package
    Classic confinementsudo snap install --classic code
    Find in storesnap find keyword

    Common Snaps: code, discord, spotify, slack, postman, chromium


    4. System Administration

    TaskCommand
    List servicessystemctl list-unit-files --type=service
    Enable servicesudo systemctl enable service
    Start servicesudo systemctl start service
    Statussystemctl status service
    View logsjournalctl -u service
    Rebootsudo reboot
    Shutdownsudo poweroff
    Disk usagedf -h
    Memoryfree -h
    Processeshtop or top
    Kill processkill PID or pkill name
    Check Ubuntu versionlsb_release -a or cat /etc/os-release

    5. Users & Permissions

    ActionCommand
    Add usersudo adduser username
    Add to sudo groupsudo usermod -aG sudo username
    Change passwordsudo passwd username
    Change ownersudo chown user:group file
    Change permissionschmod 755 file
    Switch usersu - username

    6. Networking

    TaskCommand
    Check IPip a or nmcli device show
    List Wi-Finmcli device wifi list
    Connect Wi-Finmcli device wifi connect SSID password "pass"
    Restart NetworkManagersudo systemctl restart NetworkManager
    Check DNScat /etc/resolv.conf
    Test connectionping -c 4 google.com
    Firewall (UFW)sudo ufw status
    sudo ufw allow 22/tcp
    sudo ufw enable

    7. Filesystem & Storage

    TaskCommand
    Mount USBsudo mount /dev/sdb1 /mnt/usb
    Unmountsudo umount /mnt/usb
    Format ext4sudo mkfs.ext4 /dev/sdX1
    Check disksudo fsck /dev/sdX1
    Find large filesdu -ah / | sort -rh | head -n 20
    Search filesfind / -name "filename" 2>/dev/null
    Disk analyzer (GUI)baobab

    8. Server-Specific

    ServiceInstall & Enable
    LAMP Stacksudo apt install apache2 mysql-server php libapache2-mod-php
    Nginx + PHPsudo apt install nginx php-fpm
    Dockersudo apt install docker.io
    sudo usermod -aG docker $USER
    Node.jscurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    sudo apt install nodejs
    PostgreSQLsudo apt install postgresql

    9. Troubleshooting

    IssueCommand
    Boot to recoveryGRUB → Advanced → Recovery Mode
    Fix broken packagessudo dpkg --configure -a
    sudo apt install -f
    Reinstall GRUB (UEFI)sudo grub-install /dev/sdX
    sudo update-grub
    Clear journal logssudo journalctl --vacuum-time=2weeks
    Boot errorsjournalctl -b -p err
    Regenerate initramfssudo update-initramfs -u
    Check hardwarelscpu, lsblk, lspci, lsusb

    10. Useful Tools to Install

    sudo apt install \
        vim htop git curl wget unzip tree \
        net-tools ufw gnome-tweaks \
        build-essential dkms linux-headers-$(uname -r)

    11. One-Liners

    # Full system update + clean
    sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove && sudo apt clean
    
    # Enable UFW with SSH allowed
    sudo ufw allow OpenSSH && sudo ufw enable
    
    # Show Ubuntu version
    lsb_release -a
    
    # Update snaps
    sudo snap refresh
    
    # Backup apt sources
    cp /etc/apt/sources.list ~/sources.list.bak
    
    # List all PPAs
    grep ^deb /etc/apt/sources.list /etc/apt/sources.list.d/*
    
    # Reboot into recovery
    sudo systemctl reboot --firmware-setup  # (UEFI)

    12. Ubuntu Flavors & Resources

    FlavorCommand / Note
    Ubuntu ServerMinimal CLI install
    Ubuntu DesktopFull GNOME experience
    KubuntuKDE Plasma
    XubuntuXFCE (lightweight)
    LubuntuLXQt
    Ubuntu MATEClassic desktop

    Official Docs: https://ubuntu.com/tutorials
    Ask Ubuntu: https://askubuntu.com


    13. Pro Tips

    • Use ubuntu-drivers autoinstall for NVIDIA/AMD drivers
    • Enable Minimized Updates in Software & Updates
    • Use apt-mark hold package to prevent updates
    • Backup with deja-dup (GUI) or rsync
    • Enable Firewall: sudo ufw enable
    # Auto-accept reboots after updates (server)
    sudo needrestart -a
  • Fedora Linux Cheatsheet

    Fedora Linux Cheatsheet

    Essential commands for installation, package management, system administration, and troubleshooting
    Uses dnf (primary) and flatpak/rpm-ostree (for Silverblue/Atomic). All privileged commands require sudo.


    1. Installation (Live USB / Anaconda)

    TaskCommand / Action
    Boot live ISOSelect “Start Fedora-Workstation”
    Launch installerClick “Install to Hard Drive”
    Disk partitioningUse Blivet-GUI or manual (/boot/efi, /, swap)
    Post-install (first boot)Complete user setup via GNOME Initial Setup
    Manual install (netinstall)Boot netinstall ISO → dnf install @base-x (or minimal)
    Enable RPM Fusion (Free & Nonfree)sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
    sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
    Update systemsudo dnf upgrade --refresh

    2. DNF (Package Management)

    ActionCommand
    Update systemsudo dnf upgrade --refresh
    Install packagesudo dnf install package
    Remove packagesudo dnf remove package
    Search packagednf search keyword
    List installeddnf list installed
    Autoremove unusedsudo dnf autoremove
    Clean cachesudo dnf clean all
    View package infodnf info package
    List files in packagerpm -ql package
    Which package owns filednf provides /path/to/file
    Enable COPR reposudo dnf copr enable user/repo
    History (undo/redo)dnf history
    sudo dnf history undo ID

    Flatpak (GUI & CLI)
    flatpak install flathub org.mozilla.firefox
    flatpak update
    flatpak uninstall package


    3. System Administration (systemd)

    TaskCommand
    List servicessystemctl list-unit-files --type=service
    Enable servicesudo systemctl enable service
    Start servicesudo systemctl start service
    Statussystemctl status service
    View logsjournalctl -u service
    Rebootreboot
    Shutdownpoweroff
    View kernel messagesdmesg | less
    Disk usagedf -h
    Memoryfree -h
    Processeshtop or top
    Kill processkill PID or pkill name

    4. Users & Permissions

    ActionCommand
    Add usersudo useradd -m username
    Set passwordsudo passwd username
    Add to wheel (sudo)sudo usermod -aG wheel username
    Change ownersudo chown user:group file
    Change permissionschmod 755 file

    5. Networking

    TaskCommand
    Check IPip a or nmcli device show
    List Wi-Finmcli device wifi list
    Connect Wi-Finmcli device wifi connect SSID password "pass"
    Restart NetworkManagersudo systemctl restart NetworkManager
    Check DNScat /etc/resolv.conf
    Firewall (firewalld)sudo firewall-cmd --list-all
    sudo firewall-cmd --add-service=http --permanent

    6. Filesystem & Storage

    TaskCommand
    Mount USBsudo mount /dev/sdb1 /mnt/usb
    Unmountumount /mnt/usb
    Format ext4sudo mkfs.ext4 /dev/sdX1
    Check disksudo fsck /dev/sdX1
    Find large filesdu -ah / | sort -rh | head -n 20
    Search filesfind / -name "filename" 2>/dev/null

    7. Fedora Variants

    Fedora Silverblue / Kinoite (Immutable)

    TaskCommand
    Rebase to new versionrpm-ostree upgrade
    rpm-ostree rebase fedora:fedora/40/x86_64/silverblue
    Layer packagerpm-ostree install package
    Remove layeredrpm-ostree override remove package
    Rollbackrpm-ostree rollback
    Check statusrpm-ostree status
    Boot into previousSelect from GRUB

    Toolbox (containerized dev)
    toolbox create
    toolbox enter


    8. Troubleshooting

    IssueCommand
    Boot to recoveryGRUB → e → add systemd.unit=rescue.target → Ctrl+X
    Fix broken depssudo dnf distro-sync
    Reinstall all packagessudo dnf reinstall $(dnf list installed | awk '{print $1}')
    Clear journalsudo journalctl --vacuum-time=2weeks
    Boot errorsjournalctl -b -p err
    Regenerate initramfssudo dracut -f
    Update GRUBsudo grub2-mkconfig -o /boot/grub2/grub.cfg (BIOS)
    sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg (UEFI)

    9. Useful Tools to Install

    sudo dnf install vim htop git curl wget unzip tree dnf-automatic firewall-config

    10. One-Liners

    # Full update + clean
    sudo dnf upgrade --refresh && sudo dnf autoremove && sudo dnf clean all
    
    # Enable fastest mirrors
    sudo dnf install dnf-plugins-core
    sudo dnf config-manager --set-enabled fedora-cisco-openh264
    echo "fastestmirror=True" | sudo tee -a /etc/dnf/dnf.conf
    
    # Show orphan packages
    dnf leaves
    
    # Update Flatpaks
    flatpak update
    
    # Rebase Silverblue to latest
    rpm-ostree update && reboot

    11. Fedora Docs & Resources

    Official Docs: https://docs.fedoraproject.org
    Ask Fedora: https://ask.fedoraproject.org

    # Install offline docs
    sudo dnf install fedora-docs

    12. Quick Install Scripts

    # Post-install script (Workstation)
    sudo dnf install https://rpmfusion.org/... (both repos)
    sudo dnf upgrade --refresh
    sudo dnf install vim htop git @development-tools

    Pro Tip: Use gnome-software or dnfdragora for GUI package management.
    For immutability: Silverblue + Toolbox + Flatpak = future-proof desktop


  • Arch Linux Cheatsheet

    Arch Linux Cheatsheet

    Essential commands for installation, package management, system administration, and troubleshooting
    Assumes pacman as primary package manager. All commands require sudo unless run as root.


    1. Installation (Live USB/ISO)

    TaskCommand
    Update keyring (critical first step)pacman -Sy archlinux-keyring --noconfirm
    Sync mirrors (fastest)reflector --latest 10 --sort rate --save /etc/pacman.d/mirrorlist
    List diskslsblk -f or fdisk -l
    Partition disk (example: UEFI + root)cfdisk /dev/sdX
    Format partitionsmkfs.fat -F32 /dev/sdX1 (EFI)
    mkfs.ext4 /dev/sdX2 (root)
    Mount partitionsmount /dev/sdX2 /mnt
    mkdir -p /mnt/boot && mount /dev/sdX1 /mnt/boot
    Install base systempacstrap /mnt base linux linux-firmware
    Generate fstabgenfstab -U /mnt >> /mnt/etc/fstab
    Chroot into systemarch-chroot /mnt
    Set timezoneln -sf /usr/share/zoneinfo/Region/City /etc/localtime
    hwclock --systohc
    Set localeEdit /etc/locale.gen → uncomment en_US.UTF-8 UTF-8
    locale-gen
    echo "LANG=en_US.UTF-8" > /etc/locale.conf
    Set hostnameecho "myhostname" > /etc/hostname
    Add to /etc/hosts127.0.0.1 localhost
    ::1 localhost
    127.0.1.1 myhostname.localdomain myhostname
    Set root passwordpasswd
    Install bootloader (GRUB UEFI)pacman -S grub efibootmgr
    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
    grub-mkconfig -o /boot/grub/grub.cfg
    Enable network (systemd)pacman -S networkmanager
    systemctl enable NetworkManager
    Exit & rebootexit
    umount -R /mnt
    reboot

    2. Pacman (Package Management)

    ActionCommand
    Update systempacman -Syu
    Install packagepacman -S package
    Remove package (with deps)pacman -Rns package
    Search packagepacman -Ss keyword
    List installed packagespacman -Q
    List explicitly installedpacman -Qe
    Clean cache (keep last 3 versions)paccache -rk 3
    Remove untracked packagespacman -Rns $(pacman -Qdtq)
    View package infopacman -Qi package
    List files in packagepacman -Ql package
    Which package owns filepacman -Qo /path/to/file
    Sync databasepacman -Syy
    Force refreshpacman -Syyu

    AUR Helper (yay/paru)
    Install: pacman -S --needed git base-devel
    git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
    Use: yay -S package (replaces pacman for AUR)


    3. System Administration

    TaskCommand
    List servicessystemctl list-unit-files --type=service
    Enable servicesystemctl enable service
    Start servicesystemctl start service
    Check statussystemctl status service
    View logsjournalctl -u service
    Rebootreboot
    Shutdownpoweroff
    View kernel messagesdmesg | less
    Check disk usagedf -h
    Check memoryfree -h
    List processeshtop or top
    Kill processkill PID or pkill name
    Edit config (nano/vim)nano /path/to/file
    Backup pacman databasecp -r /var/lib/pacman /backup/

    4. Users & Permissions

    ActionCommand
    Add useruseradd -m -G wheel username
    Set user passwordpasswd username
    Enable sudo for wheelEDITOR=nano visudo → uncomment %wheel ALL=(ALL) ALL
    Change file ownerchown user:group file
    Change permissionschmod 755 file

    5. Networking

    TaskCommand
    Check IPip a
    Test connectionping archlinux.org
    Wi-Fi (iwctl)iwctl → station wlan0 scan → connect SSID
    Enable Wi-Fisystemctl enable --now iwd
    Check DNScat /etc/resolv.conf
    Restart NetworkManagersystemctl restart NetworkManager

    6. Filesystem & Storage

    TaskCommand
    Mount USBmount /dev/sdb1 /mnt/usb
    Unmountumount /mnt/usb
    Format ext4mkfs.ext4 /dev/sdX1
    Check filesystemfsck /dev/sdX1
    Find large filesdu -ah / | sort -rh | head -n 20
    Search filesfind / -name "filename"

    7. Troubleshooting

    IssueCommand
    Boot into recoveryHold Shift at boot → GRUB → e → add systemd.unit=rescue.target
    Fix broken packagespacman -Dk (check deps)
    pacman -Syu --overwrite '*'
    Reinstall all packagespacman -Qnq | pacman -S -
    Clear journal logsjournalctl --vacuum-time=2weeks
    Check boot errorsjournalctl -b -p err
    Regenerate initramfsmkinitcpio -P
    Update GRUBgrub-mkconfig -o /boot/grub/grub.cfg

    8. Useful Tools to Install

    pacman -S vim htop git curl wget unzip tree reflector rsync

    9. One-Liners

    # Full system update + clean
    pacman -Syu && paccache -ruk0 && pacman -Rns $(pacman -Qdtq)
    
    # Mirrorlist (fastest 10 servers)
    reflector --latest 10 --sort rate --save /etc/pacman.d/mirrorlist && pacman -Syy
    
    # Show orphan packages
    pacman -Qdt
    
    # Rebuild AUR packages after upgrade
    yay -Syu --rebuildall

    10. Arch Wiki Shortcut

    Always check: https://wiki.archlinux.org

    # Search wiki offline (install arch-wiki-docs)
    pacman -S arch-wiki-docs
    wiki-search "query"

    Pro Tip: Keep archinstall script for automated installs:

    pacman -S archinstall
    archinstall