• Portada
    • Recientes
    • Usuarios
    • Registrarse
    • Conectarse

    Network configuration in Linux

    Programado Fijo Cerrado Movido Sistemas operativos
    1 Mensajes 1 Posters 474 Visitas
    Cargando más mensajes
    • Más antiguo a más nuevo
    • Más nuevo a más antiguo
    • Mayor número de Votos
    Responder
    • Responder como tema
    Accede para responder
    Este tema ha sido borrado. Solo los usuarios que tengan privilegios de administración de temas pueden verlo.
    • cobitoC Desconectado
      cobito Administrador
      Última edición por cobito

      This thread is part of the guide to set up a server on Debian.
      Remember that the content of Hardlimit is under Creative Commons license.


      Procedure

      As root:

      nano /etc/network/interfaces 

      replace the last two lines with:

      auto enp0s3 iface enp0s3 inet static address our_local_ip netmask subnet_mask gateway access_gate 

      NOTE: Remember that enp0s3 is the name of your network device and it may be different from the example. To know the name of your network device, you can type in the console:

      ip a 

      To finish:

      reboot 

      Explanation

      Due to the nature of the system (a server), it is essential to have a fixed local IP since our router will redirect the ports to that IP. If it changes, our server will be irreparably disconnected from the outside.

      To configure a static local IP we are going to edit the 'interfaces' file. To do this, as root, we write the following:

      nano /etc/network/interfaces 

      We will find this:

      89f67bbc-db85-4b4b-8c8e-e71639359397-imagen.png

      We just have to replace the last two lines with:

      auto enp0s3 iface enp0s3 inet static address our_local_ip netmask subnet_mask gateway access_gate 

      · address indicates the IP of the network device connected to the Internet. It must comply with the standard to avoid conflicts with public IP addresses. Standardized private addresses are divided into three classes: class A from 10.0.0.0 to 10.255.255.255, class B from 172.16.0.0 to 172.31.255.255 and class C from 192.168.0.0 to 192.168.255.255. The most widespread is class C.
      · netmask is the subnet mask. Usually it is 255.255.255.0.
      · gateway is the default gateway, that is, the local IP address of the router from which we connect to the Internet.

      Keep in mind that enp0s3 is the name of your network device and it may be different from the example. To know the name of your network device, you can type in the console:

      ip a 

      In my case, the configuration file would be as follows:

      c20b2802-c700-46d6-be0b-e96ceae190b2-imagen.png

      Once the changes have been made in the configuration file, we save and exit Nano. To apply the changes we must restart the system using the following command as root:

      reboot 

      When it has restarted, we will check that the IP of our machine will be the one we have entered. Obviously, to reconnect with SSH we must take this change into account:

      9e4a8a1f-124c-4c68-a1ae-30dca1aca35d-imagen.png

      Toda la actualidad en la portada de Hardlimit
      Mis cacharros

      hlbm signature

      1 Respuesta Última respuesta Responder Citar 2
      • cobitoC cobito referenced this topic on
      • cobitoC cobito referenced this topic on
      • cobitoC cobito referenced this topic on
      • 1 / 1
      • First post
        Last post

      Foreros conectados [Conectados hoy]

      0 usuarios activos (0 miembros y 0 invitados).
      febesin, pAtO,

      Estadísticas de Hardlimit

      Los hardlimitianos han creado un total de 543.5k posts en 62.9k hilos.
      Somos un total de 34.9k miembros registrados.
      roymendez ha sido nuestro último fichaje.
      El récord de usuarios en linea fue de 123 y se produjo el Thu Jan 15 2026.