Linux NIC configuration vlan tag

Source: Internet
Author: User


tools used:vconfig


New file: /etc/sysconfig/modules/8021q.modules

process: (In VLAN11,VLAN22 Bridge and eth0 as an illustration )

1. Modify the eth0 configuration file as follows:

Device=eth1

Onboot=yes

2. Create a new virtual network card configuration file ifcfg-eth1.10

device= eth1.10

Bootproto=static

ipaddr=192.168.11.20

netmask=255.255.255.0

Onboot=yes

Vlan=yes must have this configuration or the VLAN NIC will not boot after a system reboot



3. Gateway configuration file

[Email protected] ~]# cat/etc/sysconfig/network

Networking=yes

Hostname=vlan

gateway=192.168.11.1

4. load the 802.1q module and add it to the boot load

[Email protected] ~]# modprobe 8021q

Vim /etc/sysconfig/modules/8021q.modules

modprobe 8021q >/dev/null 2>&1

[email protected] ~]# chmod +x /etc/sysconfig/modules/8021q.modules

5. Create a new virtual network card and write to boot

[[email protected] ~]# vconfig add eth1 10

6. Restart the network or manually start eth1.10

[Email protected] ~]# service network restart



This article is from the "technical Discrimination" blog, please be sure to keep this source http://emg2012.blog.51cto.com/3705315/1651153

Linux NIC configuration vlan tag

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.