linux下网卡配置vlan
vconfig add eth0 900
ifconfig eth0.900 172.16.90.57/24 up
vconfig add bond0 200
ifconfig bond0.200 192.168.0.13/24 up
然后将之写到rc.local
1.需要使用到vconfig软件。首先yum安装vconfig
2.查看核心是否提供VLAN 功能,執行
代码如下:
查看是否支持,如下图表示支持
代码如下:
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
3.检查「/proc/net/vlan」档案是否存在:
代码如下:
如果沒有提供VLAN 功能,「/proc/net/vlan」目錄是不存在的。
如果存在如下所示:
代码如下:
config eth1.100 eth1.25
4.使用「m o d p ro b e 」模组命令载入「802.1q.o」模组,而且利用「lsmod」命令确认模組是否已经载入到核心內。
代码如下:
[root@CactiServ]# lsmod | grep 8021q
8021q 25493 0
garp 7152 1 8021q
5.使用vconfig命令增加子接口:增加vlan为25和vlan为100的子接口
代码如下:
vconfig add eth1 100
然后,利用ls 指令查看「/proc/net/vlan」目录下有何变化,发现多了一哥名为「eth1.25」的档案,而且可使用「ifconfig eth1.25」命令來确定VLAN 介面是否存在。
注意增加vlan,增加子接口时,首先确保eth1端口无ipadd。
6.增加好以后,利用cp命令复制接口的ip地址配置。
代码如下:
cp ifcfg-eth1 ifcfg-eth1.100
再vi修改ifcfg-eth1.25 ifcfg-eth1.100文件,设置IP地址等信息。
7.最后重启network服务。令配置生效。
linux下网卡配置vlan的更多相关文章
- Linux下网卡配置多个IP
ip addr add 192.168.12.4/24 dev eno16777728但是每次重启会失效 如果希望每次重启会重新绑定IP,可以将:ip addr add 192.168.12.X/24 ...
- linux下网卡bonding配置(转)
linux下网卡bonding配置 章节 bonding技术 centos7配置bonding centos6配置bonding 一.bonding技术 bonding(绑定)是一种linux系统 ...
- linux下网卡bonding配置
linux下网卡bonding配置 章节 bonding技术 centos7配置bonding centos6配置bonding 一.bonding技术 bonding(绑定)是一种linux系统 ...
- Linux 下网卡参数配置
目录 Linux 下网卡参数配置 第一种:修改 interfaces 文件 网卡配置实例 回环参数配置 DHCP方式配置 静态 IP 地址分配 无线网卡配置 March 17, 2015 7:48 P ...
- [转载]linux下网卡漂移导致网络不可用
转自:https://blog.csdn.net/hyatsz/article/details/47690993 linux下网卡漂移导致网络不可用 2015年08月16日 00:48:50 hyat ...
- SuSE Linux修改网卡配置
http://blog.chinaunix.net/uid-20765159-id-1850854.html SuSE Linux修改网卡配置 2010 SuSE linux ...
- linux下IPTABLES配置详解 (防火墙命令)
linux下IPTABLES配置详解 -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 24000 -j ACCEPT ...
- (转)yi_meng linux 下 ifcfg-eth0 配置 以及ifconfig、ifup、ifdown区别
linux 下 ifcfg-eth0 配置 以及ifconfig.ifup.ifdown区别 原文:https://www.cnblogs.com/yi-meng/p/3214471.html这3个命 ...
- linux 下 ifcfg-eth0 配置 以及ifconfig、ifup、ifdown区别
这3个命令的用途都是启动网络接口,不过,ifup与ifdown仅就 /etc/sysconfig/network- scripts内的ifcfg-ethx(x为数字)进行启动或关闭的操作,并不能直接修 ...
随机推荐
- 189. Rotate Array(两次反转)
DescriptionHintsSubmissionsDiscussSolution Pick One Rotate an array of n elements to the right by ...
- splay伸展树模板
普通版本: struct SplayTree { ; ], key[maxn], val[maxn], sz[maxn], lz[maxn], fa[maxn]; , ) { ch[x][]=ch ...
- Core ML 入门
1.下载Xcode 9 2.下载模型,https://developer.apple.com/machine-learning/ 3.开动.. 4.待续 模拟器66的
- Html遮罩层的显示(主要在于样式设置)
<html> <head> <title>aaa</title> <script type="text/javascript" ...
- Nginx配置location跳转后偶尔出现404
tv.xxx.com/voice请求时需跳转至:tv.xxx.com/zongyi/zt2015/haoshengyin/index.shtml 目录结构: nginx服务器配置: location ...
- web.xml filter配置
filter介绍: filter主要用于对用户请求request进行预处理,和对Response进行后处理,是个典型的处理链. 详细解析起来就是:Filter对用户请求进行预处理,接着将请求HttpS ...
- ViewResolver和ResponseBody笔记
处理HttpResponseBody有两种方式,ViewResolver(视图解析器)和ResponseBody ViewResolver.View多用于jsp,ViewResolver的主要作用是把 ...
- 延迟环境变量扩展(bat)
延迟环境变量扩展(bat) 之前遇到一些环境变量的问题,简单记录下 From:http://www.cnblogs.com/dongzhiquan/archive/2012/09/05/2671218 ...
- 【转载】解决window.showModalDialog 模态窗口中location 打开新窗口问题
来源: <http://bibipear.blog.sohu.com/143449988.html> 在我们的项目中,通常会用到showModalDialog 打开一个模态的子窗口,但是在 ...
- ASP.NET OAuth Authorization - Difference between using ClientId and Secret and Username and Password
What I don't fully understand is the use of ClientId and Secret vs Username and Password. The code ...