Skip to content

Instantly share code, notes, and snippets.

@nullx5
Last active May 5, 2024 06:46
Show Gist options
  • Save nullx5/7755196c849fb413afc021be738ab907 to your computer and use it in GitHub Desktop.
Save nullx5/7755196c849fb413afc021be738ab907 to your computer and use it in GitHub Desktop.

Configurar IP en Debian y Ubuntu

Método 1: Editando el archivo /etc/network/interfaces

auto wlp0s20f3
iface wlp0s20f3 inet static
    address 192.168.100.100
    netmask 255.255.255.0
    gateway 192.168.100.1
    dns-nameservers 8.8.8.8 1.1.1.1

sudo systemctl restart networking

sudo systemctl restart NetworkManager

ip -c a show wlp0s20f3

sudo ifup wlp0s20f3

Método 2: Editando el archivo /etc/netplan/50-cloud-init.yaml

Método 3: Usando la herramienta nmcli

nmcli device wifi list

Método 4: Usando la herramienta nmtui

Método 5: Usando el comando ip Temporal

ip -c a show wlp0s20f3
sudo ip addr add 192.168.100.100/24 dev wlp0s20f3
sudo ip addr del 192.168.100.112/24 dev wlp0s20f3
ip -c a show wlp0s20f3
ping -c 1 192.168.100.36


sudo systemctl restart NetworkManager
sudo ip link set dev wlp0s20f3 down
sudo ip link set dev wlp0s20f3 up

Ubuntu Server usa systemd-networkd

  • ls -l /lib/systemd/system/ | grep systemd-networkd.service
  • sudo systemctl status systemd-networkd.service

Ubuntu Desktop y Debian usan NetworkManager

  • ls -l /lib/systemd/system/ | grep NetworkManager.service
  • sudo systemctl status NetworkManager.service

https://www.linuxtrainingacademy.com/linux-ip-command-networking-cheat-sheet/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment