LINUX route and QOS speed limit

Source: Internet
Author: User
Article title: LINUX route and QOS speed limit. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

I have been paying attention to and trying LINUX for a long time, but it is rarely used. I just need a vro in the unit, and I have an idle old host to improve my practical ability! There are a lot of mistakes in online articles, so there are some twists and turns. I hope to sum up this experience for the sake of forgetting.

After ubuntu server 8.04 is installed, set the dual Nic: eth0 to the Internet Nic, and eth1 to the intranet Nic,

Sudo vi/etc/network/interfaces

Auto eth0

Iface eth0 inet static

Address Internet nic ip address

Netmask subnet mask

Gateway

Auto eth1

Iface eth1 inet static

Address intranet nic ip address

Netmask subnet mask

Sudo/etc/init. d/networking restart

You can also set up a DNS server.

Sudo vi/etc/resolv. conf (by default, the file resolv. conf does not exist in the system and is created by yourself)

Nameserver Primary DNS

Nameserver backup DNS

To enable the LINUX system to achieve this purpose, you must first check whether the IP forwarding function is enabled in the LINUX kernel. you can run the following command to view the function:

Sudo cat/proc/sys/net/ipv4/ip_forward

If the result returned by this command is 0, it indicates that IP forwarding is not enabled in the Linux kernel. You can use the following command to enable it:

Sudo echo 1>/proc/sys/net // ipv4/ip_forward

The following describes how to connect to a public IP address:

Sudo iptables? T nat? A postrouting? S 192.168.1.0/24-j SNAT ?? To XXX. XXX

XXX is the IP address of the internet nic. I have not provided any protection yet. I have hidden it first and I am not familiar with IPTABLES.

I found that I was not able to access the internet. I had to check whether I was able to access the Internet ...... I suddenly remembered that the ISP bound the MAC address of the Internet Nic ......

Add a pre-up ifconfig eth0 hw ether 88: 88: 88: 88: 88: 88: 88 (MAC address) to the NIC configuration file)

Sudo vi/etc/network/interfaces

Auto eth0

Iface eth0 inet static

Pre-up ifconfig eth0 hw ether 88: 88: 88: 88: 88: 88

Address Internet nic ip address

Netmask subnet mask

Gateway

Auto eth1

Iface eth1 inet static

Address intranet nic ip address

Netmask subnet mask

Sudo/etc/init. d/networking restart

[1] [2] Next page

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.