From: "Martín Chikilian" <slack@efn.uncor.edu>
To: netfilter@lists.netfilter.org
Subject: Re: security question
Date: Thu, 03 Jun 2004 12:06:08 -0300 [thread overview]
Message-ID: <40BF3E60.2060206@efn.uncor.edu> (raw)
a.westendoerpf@gmx.de wrote:
> Hi *!
> I have the following setup. Please tell me if I have some security
> issues here.
> A linux box with two ethernet interfaces to work as a masquerading
> router. One of them (eth0) is connected to a dsl-modem, the other is a
> wlan card (eth1). All client systems get this box a default gateway
> via dhcp.
> My goal is to drop everything coming from the wlan by default. I do
> this with:
> # iptables -t nat -P PREROUTING DROP
I don't know if i understand well what you wrote, but i think that your rule applies to drop packets being PREROUTED by default. What is the goal of this??
What you mean with "is to drop everything coming from the wlan by default" ??
You want to drop packets destined TO wlan by default???
> I want the all www-requests of the client systems to be redirected to
> the local Apache on the box. I do this with:
> # iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth1 - REDIRECT
The corect rule for this is the next one:
iptables -t nat -A POSTROUTING -p tcp --dport 80 -i eth1 -j REDIRECT
Note the POSTROUTING chain must be used (I think)
> As I need DNS for these www-requests I have to let DNS be accepted:
> # iptables -t nat -A PREROUTING -p udp --dport 53 -i eth1 -j ACCEPT
> Then, in the POSTROUTING chain I need all the packets that made it
> here to be masqueraded:
> # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> If I want to allow a specific wlan client to get outside connections I
> use:
> # iptables -t nat -I PREROUTING -m mac --mac-source XX:XX:XX:XX:XX:XX
> -i the1 -j ACCEPT
> to let him through.
> Beside of MAC-spoofing, is this setup safe? Can someone get though the
> PREROUTING chain, without being "MAC-inserted".
Sure there are ways to bypass this restriction, but it is pretty difficult, imho ;-)
> What can I do to block incoming connection attempts? I only want to
> allow ssh from outside (internet) to the box.
Through wlan?? You can do:
iptables --policy INPUT DROP /* DROP by default incoming packets
iptables --append INPUT --in-interface eth1 --destination-port ssh --jump ACCEPT
Note that if you drop incoming packets by default, you also need to add a few rules:
iptables --append INPUT --in-interface eth1 --match multiport --ports http,https,ftp,ftp-data,ssh,... --jump ACCEPT
You must add the ports that you and your clients commonly use.
Any other doubt, contact the list.
Ciao, Martin
next reply other threads:[~2004-06-03 15:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-03 15:06 Martín Chikilian [this message]
2004-06-03 15:12 ` security question Antony Stone
2004-06-04 8:24 ` Transparant proxy david
2004-06-04 7:09 ` Emilio Casbas
2004-06-04 16:25 ` david
2004-06-08 23:59 ` Djalma Fadel Junior
2004-06-09 7:55 ` Emilio Casbas
2004-06-04 13:14 ` Sheldon Hearn
2004-06-07 14:16 ` Ming Fu
-- strict thread matches above, loose matches on Subject: below --
2004-06-02 12:58 security question Andreas Westendörpf
2004-03-01 22:24 Security question bmcdowell
2004-03-01 22:47 ` John A. Sullivan III
2004-03-01 13:41 question Sasa Stupar
2004-03-01 14:25 ` Security question Sasa Stupar
2004-03-01 15:08 ` Antony Stone
2004-03-01 12:55 Sasa Stupar
2004-03-01 13:03 ` Ray Leach
2004-03-01 13:10 ` Antony Stone
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=40BF3E60.2060206@efn.uncor.edu \
--to=slack@efn.uncor.edu \
--cc=netfilter@lists.netfilter.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