Difference between revisions of "CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication"

From Notes_Wiki
m
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb self="Configure ethernet port for 802.3 encapsulated trunk traffic communication">CentOS 8.x Network configuration|Network configuration</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 8.x]] > [[CentOS 8.x System Administration|System Administration]] > [[CentOS 8.x Network configuration|Network configuration]] > [[CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication]]
=CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication=


'''There is old article on this at [[Configuring ethernet port in trunk mode]]'''
'''There is old article on this at [[Configuring ethernet port in trunk mode]]'''


On a trunk port there can be multiple tagged VLAN traffic.  We can access traffic of a particular VLAN on a sub-interface.  To create a sub-interface we need to create sub-interface configuration file using:
On a trunk port there can be multiple tagged VLAN traffic.  We can access traffic of a particular VLAN on a sub-interface.  To create a sub-interface we need to create sub-interface configuration file using:
# Enable 8021q module using:
#:<pre>
#:: modprobe 8021q
#:: lsmod | grep 802
#:</pre>
# Enable module on boot by creating '<tt>/etc/modules-load.d/01-8021q.conf</tt>' with:
#:<pre>
#:: 8021q
#:</pre>
# To access traffic of a particular VLAN on a sub-interface, create sub-interface configuration file '<tt>/etc/sysconffig/network-scripts/ifcfg-&lt;interface-name&gt;.&lt;vlan-id&gt;</tt>'.
# To access traffic of a particular VLAN on a sub-interface, create sub-interface configuration file '<tt>/etc/sysconffig/network-scripts/ifcfg-&lt;interface-name&gt;.&lt;vlan-id&gt;</tt>'.
#:Example name <tt>/etc/sysconfig/network-scripts/ifcfg-eth0.101</tt> if interface eth0 is in trunk mode with VLAN 101 traffic coming tagged.
#:Example name <tt>/etc/sysconfig/network-scripts/ifcfg-eth0.101</tt> if interface eth0 is in trunk mode with VLAN 101 traffic coming tagged.
#::<pre>
#::<pre>
#::: VLAN=yes
#::: TYPE=Vlan
#::: PHYSDEV=eth0
#::: VLAN_ID=101
#::: REORDER_HDR=yes
#::: GVRP=no
#::: MVRP=no
#::: HWADDR=
#::: PROXY_METHOD=none
#::: BROWSER_ONLY=no
#::: BOOTPROTO=none
#::: IPADDR=10.100.1.11
#::: PREFIX=24
#::: GATEWAY=10.100.1.1
#::: DNS1=10.100.1.2
#::: DEFROUTE=yes
#::: IPV4_FAILURE_FATAL=no
#::: IPV6_DISABLED=yes
#::: IPV6INIT=no
#::: NAME=eth0.101
#::: DEVICE=eth0.101
#::: DEVICE=eth0.101
#::: NAME=eth0.101
#::: VLAN=yes
#::: BOOTPROTO=static  #Or BOOTPROTO="none" or BOOTPROTO="DHCP", etc.
#::: ONBOOT=yes
#::: ONBOOT=yes
#::: IPADDR=""
#::: NETMASK=""
#::: GATEWAY=""
#::: DNS1=""
#::: DNS2=""
#::</pre>
#::</pre>
#::and so on as per requirement.
#::and so on as per requirement.
Line 26: Line 46:




Refer: https://www.snel.com/support/802-1q-vlan-tagging-in-centos-8/ esp. if you want to use ip routing 2 along with sub-interfaces.
Note:
* You can use
*:<pre>
*:: nmtui
*:</pre>
*:: to configure appropriate interface and learn about the configuration parameters'''
 
Refer:
* https://tutoexpress.com/index.php/centos-configuring-802-1q-tag-vlan/ to see how to do the same via ip command






<yambe:breadcrumb self="Configure ethernet port for 802.3 encapsulated trunk traffic communication">CentOS 8.x Network configuration|Network configuration</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 8.x]] > [[CentOS 8.x System Administration|System Administration]] > [[CentOS 8.x Network configuration|Network configuration]] > [[CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication]]

Latest revision as of 03:51, 19 April 2022

Home > CentOS > CentOS 8.x > System Administration > Network configuration > CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication

There is old article on this at Configuring ethernet port in trunk mode

On a trunk port there can be multiple tagged VLAN traffic. We can access traffic of a particular VLAN on a sub-interface. To create a sub-interface we need to create sub-interface configuration file using:

  1. Enable 8021q module using:
    modprobe 8021q
    lsmod | grep 802
  2. Enable module on boot by creating '/etc/modules-load.d/01-8021q.conf' with:
    8021q
  3. To access traffic of a particular VLAN on a sub-interface, create sub-interface configuration file '/etc/sysconffig/network-scripts/ifcfg-<interface-name>.<vlan-id>'.
    Example name /etc/sysconfig/network-scripts/ifcfg-eth0.101 if interface eth0 is in trunk mode with VLAN 101 traffic coming tagged.
    VLAN=yes
    TYPE=Vlan
    PHYSDEV=eth0
    VLAN_ID=101
    REORDER_HDR=yes
    GVRP=no
    MVRP=no
    HWADDR=
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=none
    IPADDR=10.100.1.11
    PREFIX=24
    GATEWAY=10.100.1.1
    DNS1=10.100.1.2
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6_DISABLED=yes
    IPV6INIT=no
    NAME=eth0.101
    DEVICE=eth0.101
    ONBOOT=yes
    and so on as per requirement.
  4. Restart network and see if sub-interface is up and running as expected
    nmcli networking off; nmcli networking on


Note:

  • You can use
    nmtui
    to configure appropriate interface and learn about the configuration parameters

Refer:


Home > CentOS > CentOS 8.x > System Administration > Network configuration > CentOS 8.x Configure ethernet port for 802.3 encapsulated trunk traffic communication