Rocky Linux 9 configure VLANs on eth. port

Hello community.
I’m new here, sorry if my topic is in wrong place or already discussed.
I already tried few methods - nmtui, nmcli, network-scripts, etc. but no success.
My situation
I have bare metal server with Rocky Linux 9 installed, have two network ports connected, one with access port, with IP address and it works fine, there is no problem. Second network port is connected on trunk port, with few VLANs, but no native VLAN, there is no any IP address.
My task.
I want make so, need to receive for example VLAN 20 and VLAN 21 traffic on this port, capture it and save in file. Capture and save is no problem, I have problem to receive traffic on VLANs. How can I add VLANs on port eth1 so to receive traffic from outside. I used nmtui, nmcli, network-scripts, etc. no success. I can’t receive any traffic on VLANs.
I don’t need go outside with this VLANs, I just need receive packets. If someone can suggest me, how can I do my task, please, don’t hesitate.
Thank you.

You have port eth1 that sees tagged packets.

With examples in man nmcli and man nmcli-examplesand assuming that the name of connection is “eth1”:

# Remove IP addresses from existing connection
nmcli con mod eth1 ipv4.method disabled ipv6.method disabled

# Add interface for VLAN 20
nmcli con add con-name vlan-20 ifname v20 type vlan dev eth1 id 20 ipv4.method disabled ipv6.method disabled
# Add interface for VLAN 21
nmcli con add con-name vlan-21 ifname v21 type vlan dev eth1 id 21 ipv4.method disabled ipv6.method disabled

When these connections are properly up, there should be two new interface devices “v20” and “v21”.
Neither interface will have any IP address on them.
If you do listen on “v20”, then you should see packets of VLAN 20, but they will not have the VLAN tag.
If you do listen on “eth1”, then you should see the same packets, but tagged, (and also all the other traffic on the wire).

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.