From: Djamil ESSAISSI <djamil@francexpress.com>
To: gentoo-dev@cvs.gentoo.org
Subject: Re: [gentoo-dev] NAT iptables info
Date: Tue Oct 2 04:13:01 2001 [thread overview]
Message-ID: <20011002122143.64aa2434.djamil@francexpress.com> (raw)
In-Reply-To: <3BB8D91C.C52CDE0C@gentoo.org>
I fortunatly know what u mean, so i give you as an example my little farm at home ...:
first you have to know: eth0 is hookedup to the DSLmodem
eth1 is hookedup to the LAN
ppp0 is the outside link (can be DSL , DIAL UP or even a VPN!)
adsl-start < the stuff of rp-dsl that comes with gentoo...
#Open tha door
route add -net 0.0.0.0 gw 62.4.19.XXX < the IP on the PPP connection in my case it is static ;).
#Open sesame !
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE < masquerade the bludy LAN thru ppp0
iptables -A FORWARD -i eth1 -j ACCEPT < and do me some forwarding too coming from eth1 [remember eth1 is the LAN side]
#Get me FTP
iptables -t nat -A PREROUTING -p tcp -d 62.4.19.XXX/32 --dport 21 -j DNAT --to 192.168.0.2:21 <<< this is how i use a PIII500/512M as a web
iptables -t nat -A PREROUTING -p tcp -d 62.4.19.XXX/32 --dport 20 -j DNAT --to 192.168.0.2:20 <<< ftp server behinde a good old p100 .
#Get me HTTP/S
iptables -t nat -A PREROUTING -p tcp -d 62.4.19.XXX/32 --dport 80 -j DNAT --to 192.168.0.2:80 <<<
iptables -t nat -A PREROUTING -p tcp -d 62.4.19.XXX/32 --dport 443 -j DNAT --to 192.168.0.2:443 <<<
#get me ssh
iptables -t nat -A PREROUTING -p tcp -d 62.4.19.XXX/32 --dport 24 -j DNAT --to 192.168.0.2:22 <<< or even use another port to open aonther ssh on the inside machine.
NOTE: there is no firewalling involved here !!! this makes it work only --- it doesnt protect any machine for example: if you got SUB7 on a win98 machine the Lame can get to you machine: but this set up is sweet when i run CS/HL server on an inside machine ...hard to beleive ! it WORKS !
BUT you still can protect it but blocking ports/ips ... good luck and be carefull.
NOTE also that this runs on gentoo so maybe i passed over some steps as they may have been already setup by default ...
grutz.
Djamil-
next prev parent reply other threads:[~2001-10-02 10:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-01 15:02 [gentoo-dev] NAT iptables info Donny Davies
2001-10-01 17:01 ` AW: " Sebastian Werner
2001-10-01 20:29 ` Chad Huneycutt
2001-10-02 4:13 ` Djamil ESSAISSI [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-10-03 13:15 Sherman Boyd
2001-10-03 13:39 Donny Davies
2001-10-03 13:46 ` Michael M Nazaroff
2001-10-03 18:12 ` Collins Richey
2001-10-03 13:53 Sean Mitchell
2001-10-04 4:54 ` Djamil ESSAISSI
2001-10-04 13:29 ` Daniel Robbins
2001-10-04 14:31 ` Nathaniel Grady
2001-10-05 3:47 ` Djamil ESSAISSI
2001-10-05 10:28 ` Daniel Robbins
2001-10-04 14:48 Sherman Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011002122143.64aa2434.djamil@francexpress.com \
--to=djamil@francexpress.com \
--cc=gentoo-dev@cvs.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox