添加vlan

[root@localhost network-scripts]# vconfig add eth1 109

配置文件,此处配置了vlan109使用子接口进行多ip配置:

[root@localhost network-scripts]# cat ifcfg-eth1.109\:0
DEVICE=eth1.109:0
HWADDR=68:05:CA:25:FC:43
TYPE=Ethernet
UUID=05ed80f3-7699-4702-b93e-016d8b84067d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
VLAN=yes
IPADDR=192.168.15.230
NETMASK=255.255.255.0 [root@localhost network-scripts]# cat ifcfg-eth1.109\:1
DEVICE=eth1.109:1
HWADDR=68:05:CA:25:FC:43
TYPE=Ethernet
UUID=05ed80f3-7699-4702-b93e-016d8b84067d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.50.230
NETMASK=255.255.255.0
VLAN=yes
如果是一个vlan一个ip地址如下:
[root@localhost network-scripts]# cat ifcfg-eth1.112
DEVICE=eth1.112
HWADDR=68:05:CA:25:FC:43
TYPE=Ethernet
UUID=05ed80f3-7699-4702-b93e-016d8b84067d
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
VLAN=yes
IPADDR=192.168.46.230
NETMASK=255.255.255.0

以上配置重启网卡生效,自动创建vlan关系:

[root@localhost network-scripts]# service network restart
Shutting down interface eth1.104: [ OK ]
Shutting down interface eth1.112: [ OK ]
Shutting down interface eth1.113: [ OK ]
Shutting down interface eth1.124: [ OK ]

查看vlan信息:

[root@localhost network-scripts]# cat /proc/net/vlan/config
VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth1.109 | 109 | eth1
eth1.104 | 104 | eth1
eth1.112 | 112 | eth1
eth1.113 | 113 | eth1
eth1.124 | 124 | eth1

最新文章

  1. 《你不知道的javascript》一、函数作用域和块作用域
  2. MVC之Razor语法
  3. ZOJ --- 3516 Tree of Three
  4. DeDe缩略图路径的修改
  5. 用Apache Ivy实现项目里的依赖管理
  6. iOS开发app自动更新的实现
  7. mysql(七)
  8. 动态令牌验证遇到的问题(判断用户长按backspace键)
  9. Robot Framework - 一些练习
  10. fedora 29 桌面版 设置 cockpit 自动开机启动
  11. AWS 为 Elasticsearch 推出开源发行版
  12. 让Xcode8.0支持iOS11.2设备真机测试
  13. ython进阶06 循环对象
  14. 【BZOJ2879】【NOI2012】美食节(费用流)
  15. Maven入门使用(一)
  16. ElasticSearch的x-pack配置查询
  17. JavaMail实现邮件的发送
  18. vim有用的快捷键
  19. JavaScript01天学习笔记分享
  20. Eclipse Che开发Spring Web应用(入门) (二)

热门文章

  1. ABAP POPUP函数
  2. XHTML标签的嵌套规则分析
  3. linux和mac下的nginx和php的安装
  4. ReportViewer 不预览,直接导出 PDF文件
  5. [linux] 结构化命令-for
  6. 搭建selenium自动化环境步骤
  7. windows读取mac格式移动硬盘的方法
  8. 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)'
  9. Codeforces Round #379 (Div. 2) Analyses By Team:Red & Black
  10. Unity3D安卓打包参数配置与兼容性的关系分析