环境
- Red Hat Enterprise Linux 6
- initscripts-9.03.46-1.el6 or higher
问题
- Want to create a VLAN interface without using the standard naming scheme of eth0.10
- Is it possible to make a VLAN or rename one so its name is not limited to {device}.{vlan}?
决议
- 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:
Raw
DEVICE=outside-network
VLAN=yes
PHYSDEV=eth0
VID=10
BOOTPROTO=dhcp
ONBOOT=yes