Route again in Linux

Source: Internet
Author: User
Use Linux to route again-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Existing conditions:
1. Get an intranet IP address that can access the Internet: (pull it from the Internet cafe on the second floor)
IP: 192.168.0.100
Gateway: 192.168.0.1
DNS: 202.96.134.20.
202.96.154.15
2. C333 192 M 6.4G Tp-link 8139*2,
Eth0
Ip 192.168.0.100
Subnet Mask limit 255.0
Gateway 192.168.0.1
DNS 202.96.134.20.
Eth1
Ip 172.21.0.1
Subnet Mask limit 255.0
Gateway 192.168.0.1
DNS 202.96.134.20.
3. 8X10 M/100 m hub.
To do the following:
Use the Linux route, NAT, and DHCP functions!
The IP address automatically assigned by the client with DHCP is 172.21.0.xxx and the gateway is 172.21.0.1 Subnet Mask.
255.255.255.0 DNS is 202.96.134.20.
Can I use Linux as the proxy DNS, so that I can write the same gateway and DNS!
Note: linux redhat 7.0
You can use Linux as a proxy. You can use ipchains or iptables. We recommend that you use iptables. In addition, your operating system version is a little low. install more than 7.2.
Using ipchains
Enable forwarding first
Insmod ip masq_ftp
Ipchans-A forward-s 172.21.x.x/16-d 0/0-j MASQ
Use iptables
Enable forwarding first
Insmod ip_conntrack
Insmod ip_conntrack_ftp
Insmod ip_nat_ftp
Iptables-t nat-a postrouting-s 172.16.x.x/16-j MASQUERADE
DHCP options
/Etc/dhcpd. conf
Default-lease-time 600;
Max-lease-time 7200;
Option subnet-mask 255.255.0.0;
Option broadcast-address 172.21.255.255;
Option routers 172.21.254.254;
Option domain-name-servers 202.96.134.133;
Subnet 172.21.0.0 netmask 255.255.255.0.0 {
Range 172.21.1.1 172.21.1.254;
}

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.