Create Vlan for Interface for Ubuntu and Fedore

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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值