In Ubuntu, this article uses Ubuntu: to enable the net. ipv4.ip _ forward1 option in/etc/sysctl. conf to write the following script file. Proxy. sh #! /Bin/shsysctl-p/sbin/modprobeip_tables/sbin/modprobeip_nat_ftp # if this machine is
This article passes the test in ubuntu 9.04
Ubuntu 9.04:
Enable the net. ipv4.ip _ forward = 1 option in/etc/sysctl. conf.
Write the following script file.
Proxy. sh
#! /Bin/sh
Sysctl-p
/Sbin/modprobe ip_tables
/Sbin/modprobe ip_nat_ftp
# If this machine is dial-up, EXTIF may be ppp +
# If multiple NICs exist, EXTIF is the corresponding Nic.
EXTIF = eth3
ANY = 0.0.0.0/0
# Include all hosts in the 172.16.0.0/16 Lan
LAN = 172.16.0.0/16
/Sbin/
Iptables-F INPUT
/Sbin/iptables-F OUTPUT
/Sbin/iptables-F FORWARD
/Sbin/iptables-F-t nat
/Sbin/iptables-P INPUT ACCEPT
/Sbin/iptables-P OUTPUT ACCEPT
/Sbin/iptables-P FORWARD ACCEPT
/Sbin/iptables-t nat-a postrouting-s $ LAN-o $ EXTIF-j MASQUERADE
Set the network administrator as the ip address of the proxy host on the machine that requires the proxy service.
EXTIF = eth3 in proxy. sh is the Internet ip address of the proxy host.
LAN = 172.16.0.0/16 indicates the intranet host that requires proxy services.
Find the DNS server address you can use.
Generally, you can use the DNS server used by the proxy host.
For example, the application scenario is as follows: