Create Vlan for Interface for Ubuntu and Fedore

来源:互联网 发布:康熙王朝 雍正王朝知乎 编辑:程序博客网 时间:2024/05/21 17:13

Ubuntu Create interface for vlan 50

Here are the steps creating vlan in Ubuntu: (I will add it to testbed setup wiki page later).
For example: eth2 is the interface with 192.168.0.X.
1. If vlan is not installed already: sudo apt-get install vlan
2. sudo modprobe 8021q
3. sudo vconfig add eth2 50
4. sudo ip addr add 172.16.10.200/24 dev eth2.50
To make the changes above permanent across reboot:
sudo su –c ‘echo “8021q” >> /etc/modules’
Add the lines below to /etc/network/interfaces:
auto eth2.50
iface eth2.50 inet static
                address 172.16.10.200
                netmask 255.255.255.0

                vlan-raw-device eth2

Fedore Create interface for vlan 50

/ect/sysconfig/network-scripts

cp ifcfg-eth0 -> ifcfg-eth0.20

edit ifcfg-eth0:

# Networking Interface
DEVICE=eth1.20
HWADDR=00:25:64:95:44:53
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
USERCTL=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=2020:DB8:20::251/64
PPERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.20.251
GATEWAY=192.168.20.252
VLAN=yes
PREFIX=23
NAME="System eth1"
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04

Some notes about vlan

1. Some network adapter chipset can't support sending traffic with vlan.

2. All windows system can't send traffic with vlan.

3. About virtual machine, for Ubuntu+Virtual Box need create eth0.50 and map to a new interface ,e,g eth1 to eth0.50, then eth1 is interface with vlan 50.

4. About virtual machine, for Windows+VMWare, only need to create vlan interface in fedore vm is ok.


0 0
原创粉丝点击