commit edcd36a31bb79ea7eb45389dc1f1b2958e31094a Author: Fabio Date: Mon Jun 23 17:01:16 2025 +0800 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..a9ba2f8 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +# Configurare IP address Debian 12 + +Verificare quale è il nome della rete + +```sh +ip a +``` + +dalla risposta si evince che la rete è ***enP3p49s0*** + +```sh +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host noprefixroute + valid_lft forever preferred_lft forever +2: enP3p49s0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether c0:74:2b:fc:61:b7 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enP3p49s0 + valid_lft 32132sec preferred_lft 32132sec + inet6 fe80::70da:ae13:b91c:cf72/64 scope link noprefixroute + valid_lft forever preferred_lft forever +3: enP4p65s0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 + link/ether c0:74:2b:fc:61:b6 brd ff:ff:ff:ff:ff:ff +``` + +editando il file /etc/network/interfaces + +```console +sudo nano /etc/network/interfaces +``` + +va scritto come + + ```sh +auto +iface inet static + address / + gateway + dns-nameservers +``` +con i seguenti campi + +```sh + is the name of your network interface. + is the desired static IP address. + is the subnet mask represented as bits (e.g., /24 for 255.255.255.0). + is the IP address of your gateway router. + are the IP addresses of your DNS servers, separated by spaces. +``` +quindi nel nostro caso va aggiunto (qui ho usato dns di google) +```sh +auto enP3p49s0 +iface enP3p49s0 inet static + address 192.168.1.4/24 + gateway 192.168.1.1 + dns-nameservers 8.8.8.8 8.8.4.4 +``` + + +### Applying Network Configuration Changes + +After editing your network configuration files, apply the changes using the ifup and ifdown commands. These commands deactivate and reactivate your network interface, respectively. +```sh +sudo ifdown enP3p49s0 && sudo ifup enP3p49s0 +``` +For the new network settings to take effect, you may also restart the networking service entirely. +```sh +sudo systemctl restart networking +```