Set up VLAN (802.1q) tagging on a network interface?
SOLUTION VERIFIED
environment
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
question
- Suppose I want a VLAN ID of 192 for the eth0 on a RHEL 5 or 6 system. What should my ifcfg-eth0 and my ifcfg-eth0.192 look like?
- How do you configure VLAN tagging on a RHEL system?
- Is it possible to configure multiple VLAN IDs on a single interface?
solution
RHEL 7 with NetworkManager
With
nmcli, create a new connection of the VLAN type wherecon-nameis the name of the connection,ifnameis the name of the VLAN interface to be created,masteris the name of the interface the VLAN will be on top of, andidis the VLAN ID (number).Using DHCP for IP addressing with a VLAN ID of 10:
# nmcli connection add type vlan ifname eth0.10 con-name myvlan id 10 dev eth0
- Or, with a static IP using example IP address 192.168.1.10/24 and gateway of 192.168.1.1:
# nmcli connection add type vlan ifname eth0.10 con-name myvlan id 10 dev eth0 ip4 192.168.1.10/24 gw4 192.168.1.1
RHEL 4, RHEL 5, RHEL 6, and RHEL 7 without NetworkManager
- Create an interface configuration file in the /etc/sysconfig/network-scripts/ directory with the name ifcfg-{device}.{vlan} where {device} is the interface the VLAN will be on top of and {vlan} is the VLAN ID (number). {device} can be either a regular interface or a bond. In the example below, the file would be called
ifcfg-eth0.10. - The ifcfg file must include the DEVICE parameter which specifies the VLAN interface name and VLAN=yes must be set:
DEVICE=eth0.10
VLAN=yes
BOOTPROTO=dhcp
ONBOOT=yes
RHEL 6 with a custom VLAN interface name
- Create an interface configuration file in the /etc/sysconfig/network-scripts/ directory with the name ifcfg-{name} where {name} is the custom name for the VLAN interface.
- The ifcfg file must include: the DEVICE parameter which specifies the custom interface name, the PHYSDEV parameter which specifies the interface the VLAN will be on top of, VID which specifies the VLAN ID (number), and VLAN=yes must be set. PHYSDEV can be a bond.
- In the following example, a VLAN interface named "outside-network" will be created over eth0 with a VLAN ID of 10:
DEVICE=outside-network
VLAN=yes
PHYSDEV=eth0
VID=10
BOOTPROTO=dhcp
ONBOOT=yes
# This became possible in RHEL 6 with the release of initscripts-9.03.46-1.el6: RHBA-2014:1448-1
Set up VLAN (802.1q) tagging on a network interface?的更多相关文章
- vlan 以及 Linux实现的IEEE 802.1Q VLAN
vlan 以及 Linux实现的IEEE 802.1Q VLAN Vlan的概念 VLAN技术介绍 VLANVLAN概述 以太网是一种基于CSMA/CD(Carrier Sense Multiple ...
- 802.1Q VLAN技术原理
文章出处:http://hi.baidu.com/x278384/item/d56b0edfd4f56a4eddf9be79 在数据通信和宽带接入设备里,只要涉及到二层技术的,就会遇到VLAN.而且, ...
- 管理型交换机IEEE 802.1Q VLAN设置应用实例
转载标注: IEEE802.1Q 我粗略理解为对交换机入口规则和出口规则设置,入口打上VID,设置从哪些口可以出去,并且是否带标签. 一 VLAN的概念 VLAN(Virtual Local Area ...
- 802.1q VLAN
VLAN(Virtual Local Area Network),是一种通过将局域网内的设备逻辑地而不是物理地划分成一个个网段从而实现虚拟工作组的技术. 以一个网络接口为主设备,可以创建多个虚拟网络接 ...
- 如何在centos上配置802.1Q VLAN标记,linux单网卡多vlan多网段Ip配置案例
介绍 VLAN使将大型网络分成较小且易于管理的网络成为可能.802.1Q是所有供应商都在其网络设备中实施的标准.某些交换机能够将多个VLAN分配给单个网络端口.使用此功能,您可以将多个VLAN分配给单 ...
- 网络工程知识(二)VLAN的基础和配置:802.1q帧;Access、Trunk、Hybrid接口工作模式过程与配置;VLANIF的小实验
介绍-VLAN VLAN(Virtual Local Area Network)即虚拟局域网,工作在数据链路层. 交换机将通过:接口.MAC.基于子网.协议划分(IPv4和IPv6).基于策略的方式划 ...
- VLAN IEEE802.1Q
一. VLAN产生原因-广播风暴 传统的局域网使用的是HUB,HUB只有一根总线,一根总线就是一个冲突域.所以传统的局域网是一个扁平的网络,一个局域网属于同一个冲突域.任何一台主机发出的报文都会被同一 ...
- 【vlan-trunk和802.1q子接口配置】
根据项目需求,搭建好拓扑图如下: 配置sw1的g1/0/3的/trunk,把g1/0/1和g1/0/2分别加入vlan 10 和 vlan 20 配置sw1的g1/0/3的/trunk,把g1/0/1 ...
- VLAN-3-VLAN Trunk:ISL和802.1Q
(1)ISL和802.1Q概念 通过使用VLAN Trunk链路,设备可以通过一条链路发送去往多个vlan的流量.为了知道数据帧属于哪个vlan,发送方会添加原始以太网数据帧的头部,这 ...
随机推荐
- 【知识必备】内存泄漏全解析,从此拒绝ANR,让OOM远离你的身边,跟内存泄漏say byebye
一.写在前面 对于C++来说,内存泄漏就是new出来的对象没有delete,俗称野指针:而对于java来说,就是new出来的Object放在Heap上无法被GC回收:而这里就把我之前的一篇内存泄漏的总 ...
- C语言 · 乘法表
问题描述 输出九九乘法表. 输出格式 输出格式见下面的样例.乘号用"*"表示. 样例输出 下面给出输出的前几行:1*1=12*1=2 2*2=43*1=3 3*2=6 3*3=94 ...
- ABP文档 - SignalR 集成
文档目录 本节内容: 简介 安装 服务端 客户端 连接确立 内置功能 通知 在线客户端 帕斯卡 vs 骆峰式 你的SignalR代码 简介 使用Abp.Web.SignalR nuget包,使基于应用 ...
- 如何利用ansible callback插件对执行结果进行解析
最近在写一个批量巡检工具,利用ansible将脚本推到各个机器上执行,然后将执行的结果以json格式返回来. 如下所示: # ansible node2 -m script -a /root/pyth ...
- 【云知道】究极秒杀Loadrunner乱码
Loadrunner乱码一击必杀 之前有介绍一些简单的针对Loadrunner脚本或者调试输出内容中乱码的一些设置,但是并没能完全解决一些小伙伴的问题,因为那些设置实在能力有限,还是有很多做不到的事情 ...
- springmvc+bootstrap+jquerymobile完整搭建案例(提供下载地址)
用一张简单的截图说明下,然后提供一个下载地址. bootstrap的大部分样式官方都是写好的,所以只需要class="官方样式即可",具体可以看官方的案例,下面来个地址 http: ...
- HashMap的工作原理
HashMap的工作原理 HashMap的工作原理是近年来常见的Java面试题.几乎每个Java程序员都知道HashMap,都知道哪里要用HashMap,知道HashTable和HashMap之间 ...
- Mysql - 存储过程/自定义函数
在数据库操作中, 尤其是碰到一些复杂一些的系统, 不可避免的, 会用到函数/自定义函数, 或者存储过程. 实际项目中, 自定义函数和存储过程是越少越好, 因为这个东西多了, 也是一个非常难以维护的地方 ...
- Linux环境下常见漏洞利用技术(培训ppt+实例+exp)
记得以前在drops写过一篇文章叫 linux常见漏洞利用技术实践 ,现在还可以找得到(https://woo.49.gs/static/drops/binary-6521.html), 不过当时开始 ...
- (整理)MyBatis入门教程(一)
本文转载: http://www.cnblogs.com/hellokitty1/p/5216025.html#3591383 本人文笔不行,根据上面博客内容引导,自己整理了一些东西 首先给大家推荐几 ...