Configure the proxy server (iptables) in ubuntu)

Source: Internet
Author: User
In ubuntu, configure the proxy server (iptables)-Linux Enterprise Application-Linux server application information. The following is a detailed description. #! /Bin/sh
Echo "1">/proc/sys/net/ipv4/ip_forward
/Sbin/modprobe ip_tables
/Sbin/modprobe ip_nat_ftp
EXTIF = ppp +
ANY = 0.0. 0.0/0
LAN = 192.168. 0.0/24

/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

Copy the shell to a file. Run the command to use the local machine as the proxy server. (You can also write it to/etc/init. d/rc. local and execute it each time it is started)

Note that the client also needs to add the server to the routing gateway and set its own DNS.

The command is as follows:
Set route: sudo route add gw 192.168.0.1

Modify DNS: sudo gedit/etc/resolv. conf, and add nameserver xxx. xxx. x. x as the DNS server.
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.