Herramientas de usuario

Herramientas del sitio


proyectos:linuxservidor-red-comando

¡Esta es una revisión vieja del documento!


Para la administración de la red en linea de comandos, existen varios comandos que se pueden utilizar.

Comando para cambiar de forma directo cualquier parametro de red: ifconfig

ip

Herramientas del sistema para habilitar redes ya configuradas

ifup, ifdown netplan

Modelo OSI y TCP/IP

MAC y ARP

Herramientas de diagnóstico

ping

nslookup

traceroute

mtr

ss

netstat

/etc/services

nmap

iptraf-ng

dig

iftop

nethogs

vnstat

iotop

iostat

Configuración de IPs

ip

ifconfig

route

Nombres de interfaz de red

/etc/network/interfaces

/etc/resolv.conf Anterior mente solo se editaba el archivo /etc/resolv.conf y se agregaban la entrada como

nameserver 8.8.8.8 
nameserver 88.4.4
domain example.com

Con systemd se debe ver el estado con

systemd-resolve --status

Editar el archivos /etc/systemd/resolved.conf y cambiar la linea

DNS=8.8.8.8

Y reiniciar el servicio

systemctl  restart systemd-resolved

/etc/hosts

/etc/nsswitch.conf

hostname

Cambiando el hostname

sudo hostnamectl set-hostname only-host
sudo hostnamectl set-hostname host.your-fqdn-here
echo "127.0.0.1 host.your-fqdn-here" >> /etc/hosts

Verificando

hostnamectl status
dnsdomainname
hostname -f
cat /etc/hostname

ifup

ifdown

nmcli

netplan

cat /etc/netplan/50-cloud-init.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      addresses: [ 10.10.10.2/24, 'fd00::229/64' ]
      gateway4: 10.10.10.1
      gateway6: fd00::1
      nameservers:
          search: [mydomain, otherdomain]
          addresses: [10.10.10.1, 1.1.1.1]

NetworkManager

systemd

systemctl disable NetworkManager
systemctl enable systemd-networkd
systemctl enable systemd-resolved

rm /etc/resolv.conf
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
mkdir /etc/systemd/network

vi /etc/systemd/network/20-dhcp.network
[Match]
Name=enp0s3*

[Network]
#DHCP=yes
Address=10.10.0.10/24
Gateway=10.10.0.1
DNS=8.8.8.8

Referencias

proyectos/linuxservidor-red-comando.1612800435.txt.gz · Última modificación: por manuel.floresv