Configuring the NIC for VLAN trunk

Source: Internet
Author: User

Http://www.microhowto.info/tutorials/802.1q.html

Configure an Ethernet interface as a VLAN trunk

Host needs to connect 2 VLANs, on 192.168.2.1/24 VLAN 2 and on 192.168.3.1/24 VLAN 3

Modprobelsmodgrep 8021q

3 ways:

1 through configuration files

Auto Eth0. 2 iface eth0. 2 inet Static   192.168. 2.1    255.255. 255.0 auto eth0. 3 iface eth0. 3 inet Static   192.168. 3.1    255.255. 255.0

Ifup eth0. 2 ifup eth0. 3
ifconfigEth0.2eth0.2Link encap:ethernet HWaddrxx:xx:xx:xx:xx:xxinet Addr:192.168.2.1Bcast:12.168.2.255Mask:255.255.255.0Up Broadcast multicast MTU: theMetric:1RX Packets:0Errors0Dropped0Overruns:0Frame0TX Packets:0Errors0Dropped0Overruns:0Carrier0Collisions:0Txqueuelen:0RX Bytes:0(0.0b) TX Bytes:0(0.0b

If you need to specify a connection to that physical network card:

Auto Vlan2iface vlan2 inet static   192.168. 2.1    255.255. 255.0   VLAN-raw-device eth0

Http://www.microhowto.info/tutorials/802.1q.html

2 Vconfig

23
ifconfig eth0. 2 192.168. 2.1 255.255. 255.0 192.168. 2.255  ifconfig eth0. 3 192.168. 3.1 255.255. 255.0 192.168. 3.255 up

Get more information on VLAN interface

# cat/proc/net/vlan/eth0.5

Remove VLAN interface

ifconfig eth0. 5 down# vconfig rem eth0. 5

3 via IP

# IP link Add link eth0 name eth0. 2 ID 2  -D link show eth0. 2  192.168. 2.1/192.168. 2.255 Dev eth0. 2 # IP link set dev eth0. 2 up

Delete:

# IP link Set dev eth0. 2 down# IP link delete eth0. 2

After configuring, to ping eth0 IP, eth0 can receive and reply, but eth0.2 receive but not reply.

http://blog.csdn.net/suiyuan19840208/article/details/8221529

Configuring the NIC for VLAN trunk

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.