GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Vlan su Netplan in 18,04 litri?

Disclaimer:fino ad oggi sono stato un lurker, sto ancora imparando e per la prima volta in 2 anni non ho trovato alcuna risposta alla mia domanda, grazie mille per la tua lettura e spero che ne prenderai tempo per aiutare

Sto provando a configurare due VLAN sulla mia scheda LAN già esistente, lo scopo di questa configurazione è prima di far funzionare una prima VLAN prima che tutto passi attraverso VLAN diverse per scopi diversi

Ecco la mia configurazione:

Carta LAN:

cat /etc/netplan/10-enp1s0.yaml network:  version: 2  renderer: networkd  ethernets:
#LAN CARD config
   enp1s0:
     optional: true
     dhcp4: false
     dhcp6: false
     addresses: [192.168.1.91/24, ]
     gateway4: 192.168.1.254
     nameservers:
       addresses: [192.168.1.91, ] //I have a DNS on the server
       search: [domain.net]

Vlan:

cat /etc/netplan/11-vlan.11.yaml
 vlans:
   vlan.11:
     id: 11
     link: enp1s0
     optional: true
     dhcp4: false
     dhcp6: false
     addresses: [192.168.1.92/24, ]
     nameservers:
       addresses: [192.168.1.91, ]

Con questa configurazione, ecco i risultati:

  • Quando provo a eseguire il ping di vlan.11 da enp1s0 o viceversa non ricevo risposta.
  • Quando provo a eseguire il ping di qualsiasi Internet da enp1s0, funziona, ma quando provo con vlan.11, non funziona.

8.8.8.8 con enp1s0:

ping -I enp1s0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.1.91 enp1s0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=9.24 ms

8.8.8.8 con vlan.11:

ping -I vlan.11 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.1.92 vlan.11: 56(84) bytes of data.
3 packets transmitted, 0 received, 100% packet loss, time 2039ms
  • L'ultima parte e la più strana è che sono in grado di eseguire il ping di entrambi gli indirizzi con un PC diverso sulla stessa rete
Pinging 192.168.1.91 with 32 bytes of data: Reply from 192.168.1.91:
bytes=32 time<1ms TTL=64

Pinging 192.168.1.92 with 32 bytes of data: Reply from 192.168.1.92:
bytes=32 time<1ms TTL=64 Reply from 192.168.1.92: bytes=32 time<1ms
TTL=64

Quindi, puoi spiegarmi perché il mio vlan non funziona correttamente? Cosa mi manca per avere vlan.11 per comportarsi come una scheda di rete.

Grazie mille per la tua lettura e qualsiasi aiuto è molto apprezzato.

Quando scrivo sudo netplan –debug generate, vedo questo (non preoccuparti di enp2s0, non configurato né connesso per ora):

sudo netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:9423): DEBUG: 11:30:08.752: Processing input file /etc/netplan/10-enp1s0.yaml..
** (generate:9423): DEBUG: 11:30:08.752: starting new processing pass
** (generate:9423): DEBUG: 11:30:08.752: Processing input file /etc/netplan/11-vlan.11.yaml..
** (generate:9423): DEBUG: 11:30:08.752: starting new processing pass
** (generate:9423): DEBUG: 11:30:08.752: Processing input file /etc/netplan/20-enp2s0.yaml..
** (generate:9423): DEBUG: 11:30:08.752: starting new processing pass
** (generate:9423): DEBUG: 11:30:08.752: vlan.11: setting default backend to 1
** (generate:9423): DEBUG: 11:30:08.752: Configuration is valid
** (generate:9423): DEBUG: 11:30:08.752: enp2s0: setting default backend to 1
** (generate:9423): DEBUG: 11:30:08.752: Configuration is valid
** (generate:9423): DEBUG: 11:30:08.752: enp1s0: setting default backend to 1
** (generate:9423): DEBUG: 11:30:08.752: Configuration is valid
** (generate:9423): DEBUG: 11:30:08.752: Generating output files..
** (generate:9423): DEBUG: 11:30:08.752: NetworkManager: definition enp1s0 is not for us (backend 1)
** (generate:9423): DEBUG: 11:30:08.752: NetworkManager: definition vlan.11 is not for us (backend 1)
** (generate:9423): DEBUG: 11:30:08.752: NetworkManager: definition enp2s0 is not for us (backend 1)

Risposta accettata:

I tuoi file .yaml sono incompleti.

Correlati:come installare Windows 8 su Wine??

Non puoi "cancellare la configurazione della mia scheda LAN “.

Rimuovi entrambi i file .yaml e prova questo... mantieni la stessa spaziatura e indentazione e nessuna scheda...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      addresses: [192.168.1.91/24]
      gateway4: 192.168.1.254
      nameservers:
        addresses: 192.168.1.91
        search: [domain.net]
      optional: true
  vlans:
    vlan.11:
      id: 11
      link: enp1s0
      addresses: [192.168.1.92/24]

sudo netplan --debug generate # genera file di configurazione

sudo netplan apply # applica nuova configurazione

reboot # riavvia il computer


Ubuntu
  1. Come aggiornare Ubuntu 15.10 a Ubuntu 16.04 LTS

  2. Come aggiornare Ubuntu 14.04 LTS a Ubuntu 16.04 LTS

  3. Installa Karbon su Ubuntu 20.04 LTS

  4. Come aggiornare da 16.04 Lts a 16.04.1 Lts?

  5. Problemi Bluetooth in 18.04 Lts?

Come aggiornare Ubuntu 18.04 a Ubuntu 20.04 LTS

Installa CMake su Ubuntu 20.04 LTS / 21.04

Installa Mono su Ubuntu 20.04 LTS

Come installare Vai su Ubuntu 22.04 LTS

Come installare Vai su Ubuntu 18.04 LTS

Come installare Vai su Ubuntu 20.04 LTS