utmstack / UTMStack

Customizable SIEM and XDR powered by Real-Time correlation and Threat Intelligence
https://utmstack.com
GNU Affero General Public License v3.0
196 stars 18 forks source link

installation issue - vlan interface not defined[ #678

Closed NABDSOLUTIONS closed 1 month ago

NABDSOLUTIONS commented 2 months ago

I am encountering an error while trying to configure a VLAN using netplan. The specific issue is in the file /etc/netplan/00-vlan.yaml.

To Reproduce:

Edit the file /etc/netplan/00-vlan.yaml with a text editor. Attempt to define a VLAN (e.g., VLAN 10) with a specific interface name (e.g., ens2) in the link: option. Save the changes and run the command sudo netplan apply. Observe the following error message: /etc/netplan/00-vlan.yaml:9:13: Error in network definition: vlan10: interface 'ens2' is not defined Expected Behavior:

The netplan configuration should be applied successfully, and the specified VLAN should be created using the designated interface.

Environment:

OS: [Specify your Operating System - e.g., Ubuntu 22.04] Kernel Version: [You can find this by running uname -r in your terminal] Additional Context:

I have verified that the interface name mentioned in the error message (ens2 in this example) might not be the actual interface name. I used the ip addr command to list network interfaces and identify potential candidates (e.g., enpXsY). I've also checked the file permissions for /etc/netplan/00-vlan.yaml to ensure they are appropriate (ideally owner-writable only).

agauttam commented 2 months ago

Hi,

it is a network configuration issue, Once you configure the network using netcfg.yaml & 99-vlan.yaml file, it will fix your all error related to network.

NABDSOLUTIONS commented 2 months ago

Hi , we believe the configuration is right ,

(Reading database ... 108988 files and directories currently installed.) Preparing to unpack .../vlan_2.0.5ubuntu5_all.deb ... Unpacking vlan (2.0.5ubuntu5) ... Setting up vlan (2.0.5ubuntu5) ... Processing triggers for man-db (2.10.2-1) ... NEEDRESTART-VER: 3.5 NEEDRESTART-KCUR: 5.15.0-46-generic NEEDRESTART-KEXP: 5.15.0-46-generic NEEDRESTART-KSTA: 1 2024/05/13 09:38:12 Generating vlan config 2024/05/13 09:38:12 Applying vlan config /etc/netplan/99-vlan.yaml:9:13: Error in network definition: vlan10: interface 'eth0' is not defined link: eth0 ^ exit status 78


root@logs:~# cat /etc/netplan/99-vlan.yaml

network: version: 2 renderer: networkd

vlans: vlan10: id: 10 link: eth0 addresses: [10.21.199.3/24]


root@logs:~# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 94.77.xx.xx netmask 255.255.255.0 broadcast 94.77.xx.xx ether 00:16:3e:a3:53:e8 txqueuelen 1000 (Ethernet) RX packets 90016 bytes 110052814 (110.0 MB) RX errors 0 dropped 1687 overruns 0 frame 0 TX packets 51582 bytes 4682714 (4.6 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> 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 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:16:3e:a3:53:e8 brd ff:ff:ff:ff:ff:ff altname enp0s2 altname ens2 inet 94.77.xx.xx/24 brd 94.77.xx.xx scope global eth0 valid_lft forever preferred_lft forever

agauttam commented 2 months ago

Configure your interface like the below example: replace x.x.x.x to ip address and gateway

01-netcfg.yaml

network: version: 2 renderer: NetworkManager ethernets: eth0: dhcp4: no addresses: [x.x.x.x/x] routes: