Domanda Indirizzo ip statico

Shutdown-r

Utente Iron
30 Aprile 2021
7
2
1
9
Ciao sono nuovo nell' mondo della sicurezza informatica e mi piacerebbe imparare.
A tal proposito ho acquistato i due volumi di Hacklog.
Una volta iniziato a configurare l' ambiente di attacco, all' inizio del volume 2, mi sono bloccato al capitolo 2.3 perche' una volta modificato il codice /etc/network/interfaces ,ricopiandolo per filo e per segno dal manuale, e digitato il comando service networking restart, per riavviare i servizi di networking, mi appare questo errore:

Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.


E se digito ,come suggerisce l' errore, il comando "systemctl status networking.service" mi
appare questo:

● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-07-27 16:27:20 BST; 11min ago
Docs: man:interfaces(5)
Process: 2459 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Main PID: 2459 (code=exited, status=1/FAILURE)
CPU: 21ms

Jul 27 16:27:20 parrot systemd[1]: Starting Raise network interfaces...
Jul 27 16:27:20 parrot ifup[2488]: RTNETLINK answers: File exists
Jul 27 16:27:20 parrot ifup[2459]: ifup: failed to bring up eth1
Jul 27 16:27:20 parrot systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jul 27 16:27:20 parrot systemd[1]: networking.service: Failed with result 'exit-code'.
Jul 27 16:27:20 parrot systemd[1]: Failed to start Raise network interfaces.


C'e qualcuno che mi possa aiutare a capire il motivo di questi errori?
P.S e' il primo messaggio che scrivo e non so come funziona bene quindi sarei grato se portaste pazienza nel caso sia stato scortese
 
Se hai ricopiato precisamente dal manuale la cosa più probabile è che eth1 non è il nome della tua interfaccia di rete. Usa il comando ip link show per sapere il nome della tua interfaccia e sostituiscilo ad eth1 nel file che hai modificato.
 
  • Mi piace
Reazioni: IlMagoDeiTeoremi
Se hai ricopiato precisamente dal manuale la cosa più probabile è che eth1 non è il nome della tua interfaccia di rete. Usa il comando ip link show per sapere il nome della tua interfaccia e sostituiscilo ad eth1 nel file che hai modificato.
Non era quello il problema...Una volta riavviata la macchina virtuale ha funzionato.
 
Allega l'output di ip link show e il file di configurazione della scheda di rete cat /etc/network/interfaces
L' output di ip link show

Codice:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:88:fd:a6 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:6a:c1:39 brd ff:ff:ff:ff:ff:ff

L'output di "cat /etc/network/interfaces/
Codice:
# This file describes thè network interfaces available on your System
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eth0
iface lo inet dhcp

auto eth1
iface eth1 inet static
address 20.0.0.2
netmask 255.255.255.0
gateway 20.0.0.1
broadcast 20.0.0.0
 
L' output di ip link show

Codice:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:88:fd:a6 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:6a:c1:39 brd ff:ff:ff:ff:ff:ff

L'output di "cat /etc/network/interfaces/
Codice:
# This file describes thè network interfaces available on your System
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eth0
iface lo inet dhcp

auto eth1
iface eth1 inet static
address 20.0.0.2
netmask 255.255.255.0
gateway 20.0.0.1
broadcast 20.0.0.0
C'è un errore, non dovrebbe essere
iface lo inet dhcp
ma
iface eth0 inet dhcp
 
Ultima modifica:
C'è un errore, non dovrebbe essere
iface lo inet dhcp
ma
iface eth0 inet dhcp
Non me ne ero accorto. Vedo se funziona una volta corretto.

Dopo aver effettuato la correzione ho riavviato il servizio di networking. Non e' apparso nessun messaggio di errore ma, come mi era precedentemente successo, non mi potevo connettere a internet. Ho provato, quindi, a riavviare la macchina virtuale. Ma mi sono ritrovato all' inizio con gli stessi errori.
Condivido di nuovo l'output dei comandi systemctl status networking.service e cat /etc/network/interfaces/

(Ho eseguito i comandi senza i privilegi di root)

Codice:
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-08-10 20:54:29 BST; 1min 29s ago
       Docs: man:interfaces(5)
    Process: 527 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
   Main PID: 527 (code=exited, status=1/FAILURE)
        CPU: 91ms

Warning: some journal files were not opened due to insufficient permissions.

Codice:
# This file describes thè network interfaces available on your System
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 20.0.0.2
netmask 255.255.255.0
gateway 20.0.0.1
broadcast 20.0.0.0
 
  • Mi piace
Reazioni: 0xbro