You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hostname -I
# OR
hostname --all-ip-address
# OR (ip addr)
ip a
# OR
ip link
# Check the public IP behind a NAT/PAT
curl http://info.cern.ch/
# OR (info.cern.ch)
curl 188.184.21.108
# OR (they will keep your data)
dig +short myip.opendns.com @resolver1.opendns.com
# Link to cheetsheet for ip addr (old redhat, but should be approx the same):
# https://access.redhat.com/articles/ip-command-cheat-sheet
sudo netplan apply
# OR (depending on the version)
sudo systemctl restart NetworkManager
# OR (depending on the version)
sudo service network-manager restart
Change IP / Default Gateway - and restart the network
# Find the right file in /etc/netplan/
sudo nano thefile
strl+o
ctrl+x
# This is depreciated
gateway4: 192.168.1.1
# Instead use "routes" (replace with the same indentation)
routes:
- to: default
via: 192.168.1.1
# Restart the network on the server (through network manager)
sudo netplan apply
# OR (through network manager if installed)
sudo service network-manager restart
# OR (through systemd, at least on older systems)
sudo systemctl restart NetworkManager.service
Netplan - Config file "Too open"
# Should it be 600 or some other "mask"
sudo chmod 600 /etc/netplan/<00>-installer-config.yaml
Temporarily take down/up an interface
sudo ip link set ens0 down
sudo ip link set ens0 up
# OR
sudo ifconfig ens0 down
sudo ifconfig ens0 up
Check open ports
ss -patn | grep 443
ss -ltn | grep 443
Check if ssh is running
systemctl list-units | grep -i ssh
# OR
systemctl status ssh
Ethernet systemd naming convention
# eno1 — is the first on board NIC
# enp3s0f1 — is the NIC on pcibus 3 slot 0 and use the NIC function 1.
# Third character =>
# o<index>[n<phys_port_name>|d<dev_port>] — devices on board
# s<slot>[f<function>][n<phys_port_name>|d<dev_port>] — device by hotplug id
# [P<domain>]p<bus>s<slot>[f<function>][n<phys_port_name>|d<dev_port>] — devices by bus id
# x<MAC> — device by MAC address
# Why this? https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/