iface eth1 inet static
address 192.168.1.41
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255 gateway 192.168.1.1
dns-nameserver 8.8.8.8
dns-search [dominio local]
Archivo /etc/resolv.conf (no se edita, se escribe por el programa resolvconf)
search [dominio local]
nameserver [IP servidor DNS]
Aplicar la configuración reiniciando la red:
/etc/init.d/networking restart
En version 18
editar el fichero /etc/netplan/01-network-manager-all.yaml
-----------
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
dhcp6: no
addresses: [192.168.100.123/24]
gateway4: 192.168.100.254
nameservers:
addresses: [192.168.100.254,8.8.8.8]
-------------
Ejecutar
>sudo netplan apply
y comprobar
>systemctl status systemd-networkd
>ip address show dev enp0s3
Para comprobar servidores DNS
>systemd-resolve --status
Se guardan en el archivo /run/systemd/resolve/resolv.conf
Aunque en /etc/resolv.conf indica 127.0.0.53 que luego hace forward a estos primeros
Fuentes:
https://www.solusan.com/etcnetworkinterfaces-de-un-plumazo.html
https://www.todavianose.com/configurar-interface-de-red-en-versiones-de-ubuntu-17-10-o-superiores/
https://askubuntu.com/questions/1031709/ubuntu-18-04-switch-back-to-etc-network-interfaces
https://www.administradortotal.net/sistemas/linux/configurar-la-red-ubuntu-18-04-derivados/
https://aprendiendoavirtualizar.com/configurar-ip-estatica-en-ubuntu-server/
https://aprendiendoavirtualizar.com/configurar-ip-estatica-en-ubuntu-server-18-04/
https://websiteforstudents.com/configure-static-ip-addresses-on-ubuntu-18-04-beta/
https://www.techrepublic.com/article/how-to-set-dns-nameservers-in-ubuntu-server-18-04/
No hay comentarios:
Publicar un comentario