Linux adds VLAN NIC configuration

Source: Internet
Author: User

1. Edit the file/etc/sysconfig/network
Add a line inside:
Vlan=yes
2. The configuration file ifcfg-eth1.10 and ifcfg-eth1.240 that are regenerated into the NIC device
Cd/etc/sysconfig/network-scripts
CP Ifcfg-eth1 ifcfg-eth1.10
CP Ifcfg-eth1 ifcfg-eth1.240
3. editing files ifcfg-eth1.10 and ifcfg-eth1.240
The syntax that resembles writing ifcfg-eth1 in it is matching this server's IP address, netmask, network, and so on 192.168.10 network segment and 192.168.240 segment
Note: The two files of the device will be changed to eth1.10 and eth1.240 (these two files are copied by ifcfg-eth1, so it should be eth1)
4. Re-edit Ifcfg-eth1
VI ifcfg-eth1
Delete ippaddress, NETMASK, network This is a few lines related to IP address

Everything's OK. Whether it's/etc/rc.d/init.d/network restart or reboot, you'll get a system that goes straight through the 192.168.10 network segment and with the 192.168.240 segment.

Linux adds VLAN NIC configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.