Three-wire computer room Linux Server single NIC with multiple Vlanip

Source: Internet
Author: User

1. #vi/etc/iproute2/rt_tables (add Unicom, Telecom, mobile three routing tables)

#添加

Ten CNC

Tel

Cmcc

2. Need to use the Vconfig software. First Yum installs Vconfig

Yum Install Vconfig

3. #vi/etc/rc.local to set the routing table contents

#添加

Modprobe 8021q

Vconfig add eth0 60 (Unicom)

Vconfig add eth0 113 (Telecom)

Vconfig add eth0 120 (MOBILE)

Ifconfig eth0 0.0.0.0

Ifconfig eth0.60 unicom IP netmask Subnet mask up

Ifconfig eth0.113 Telco IP netmask Subnet mask up

Ifconfig eth0.120 Mobile IP netmask Subnet mask up

IP route Add the number of bits of the subnet/subnet mask that the telco IP belongs to dev eth0.113 src Telecom IP Table Tel

IP route add default via Telco Gateway table Tel

IP rule add from Telco IP table Tel

IP route Add the number of bits of subnet/subnet mask that the IP is owned by dev eth0.60 src unicom ip table cnc

IP route add default via Unicom Gateway table CNC

IP rule add from unicom IP table CNC

IP route Add the number of bits of the subnet/subnet mask that the mobile IP belongs to dev eth0.120 src Mobile IP table CMCC

IP route add default via mobile Gateway table CMCC

IP rule add from Mobile IP table CMCC

Route add default GW mobile Gateway

Why is the mobile gateway finally here? Here because the customer is a single-line access, but also a mobile IP, and then give a telecommunications IP.

Today collated out, we add, thank you!


This article is from the "Linux" blog, so be sure to keep this source http://anxia.blog.51cto.com/9179984/1605817

Three-wire computer room Linux Server single NIC with multiple Vlanip

Related Article

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.