🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.os.linux
Article #14251

Re: ������iptables��������

#14251
From: lfree
Date: Sat, 06 Oct 2001 02:53
31 lines
2524 bytes
��ӭ����news://news.cn99.com��cn.comp.os.linux������
��ʹ��www.google.com����www.google.com/linux��������Ҫ��������ĵ�


"youngtsin" <youngtsin@21cn.com> wrote in message
news:9pkb7q$8l5$1@mail.cn99.com...
> ����֮��������ֻ�ܵõ���̬IP��ַ(��ǰΪ1.2.3.4)��
> ������ͨ��绰��֪�Է�IP��ַ��
> �����Է��������WWW������(192.168.1.1)��
>
> ������д�Բ��ԣ�
> iptables -F
> iptables -t nat -F
> iptables -A PREROUTING -i ppp0 -p tcp --dport 80 -j DNAT --to 192.168.1.1
> iptables -A POSTROUTING -o eth1 -s 192.168.1.1 -j SNAT --to ppp0
> Ϊʲô���Dz�ͨ��
��û��ʵ����Ҿ���������е��ң����Լ�Ҳ�е�㣩��
����Կ���
URL http://netfilter.samba.org/unreliable-guides/cn/NAT-HOWTO-chn.tgz


POSTROUTING == > snat
PREROUTING  ===> dnat
Ӧ���޸�Ϊ��������ppp0Ϊ�ⲿ�ӿڣ�

 iptables -t nat -A PREROUTING -i ppp0 -j DNAT --to 192.168.1.1
 #�����ⲿip���Է���192.168.1.1

 iptables -t nat -A POSTOUTING -o ppp0 -j MASQUERADE
 #�����ڲ��������ַ���Գ�ȥ������
 iptables -t nat -A POSTOUTING -o ppp0 -j SNAT --to 1.2.3.4
Technical Details
Message-ID: <9pls67$apb$1@mail.cn99.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news.bentium.com!news.cn99.com!not-for-mail
References: <9pkb7q$8l5$1@mail.cn99.com>

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: 10b277,bb73bae45e757c97
X-Google-Attributes: gid10b277,public
X-Google-ArrivalTime: 2001-10-05 20:01:36 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news.bentium.com!news.cn99.com!not-for-mail
From: "lfree" <zwsqyy0483@cn899.com>
Newsgroups: cn.comp.os.linux
Subject: Re: ������iptables��������
Date: Sat, 6 Oct 2001 10:53:24 +0800
Organization: Bentium Ltd. (CN99)
Lines: 34
Message-ID: <9pls67$apb$1@mail.cn99.com>
References: <9pkb7q$8l5$1@mail.cn99.com>
NNTP-Posting-Host: 218.65.138.69
Mime-Version: 1.0
Content-Type: text/plain;
 charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Trace: mail.cn99.com 1002337288 11051 218.65.138.69 (6 Oct 2001 03:01:28 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Sat, 6 Oct 2001 03:01:28 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400