Internet access through a NAT proxy with a fixed IP address in Linux

Source: Internet
Author: User
#/Bin/sh
Iptables-F
Iptables-x
Iptables-T nat-F
Iptables-T nat-x

Echo "1">/proc/sys/NET/IPv4/ip_forward

ARP-s 192.168.0.5 00: E0: 11: 01: Ce: BD
Iptables-a forward-s 192.168.0.5-M Mac -- Mac 00: E0: 11: 01: Ce: BD-J accept
Iptables-a forward-s 192.168.0.2-J accept
Iptables-a forward-s 192.168.0.6-J accept
Iptables-a forward-s 192.168.0.0/28-J Drop
Iptables-T Nat-A postrouting-s 192.168.0.0/28-O eth1-j snat -- to-source 58.1
6.172.2

Iptables-a forward-s 192.168.1.2-J accept
Iptables-a forward-s 192.168.1.0/25-p tcp -- dport! 80-J Drop
Iptables-a forward-s 192.168.1.0/25-p udp -- dport! 53-J Drop
Iptables-T Nat-A postrouting-s 192.168.1.0/25-j snat -- to-source 58.16.172.2
Iptables-T Nat-A prerouting-s 192.168.1.0/25-I eth0-P TCP -- dport 80-J red
Irect -- to-port 3128

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.