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