config a vlan interface

I always forget how to do this, so adding this post for my reference. This is a basic example of how to add a vlan tag to a network interface……


# cat /etc/sysconfig/network-scripts/ifcfg-eth0
NAME=eth0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
#IPADDR0=192.168.100.11
#PREFIX0=24
#GATEWAY0=192.168.100.1
#DNS1=192.168.100.1
#DOMAIN=redhat.local


# cat /etc/sysconfig/network-scripts/ifcfg-eth0.200
NAME=eth0.200
VLAN=yes
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
IPADDR0=192.168.100.11
PREFIX0=24
GATEWAY0=192.168.100.1
DNS1=192.168.100.1
#DOMAIN=redhat.local

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s