From: "Rob Sterenborg" <rob@sterenborg.info>
To: netfilter@lists.netfilter.org
Subject: RE: dhcp windows client port
Date: Sat, 12 Nov 2005 18:08:14 +0100 [thread overview]
Message-ID: <20051112171451.3D7E76ADE8@smtp.sterenborg.info> (raw)
In-Reply-To: <BAY102-F3471223F91A898773DE401AE580@phx.gbl>
> i wish the windows machine which receives Internet from the
> firewall pc to be restricted fully apart from the port needed to
> access the internet
>
> the windows machine has got fully access when my rc.firewall
> contains
>
> $iptables -A FORWARD -i $LAN_IFACE -j ACCEPT
>
> which gives to the windows machine access to every port
>
> i've tried unsuccesully the following command
>
> $iptables -A FORWARD -p TCP -i $LAN_IFACE -- sport XX -j ACCEPT
>
> my netstat on the windows machine displays various connections
> few questions now
>
>
> 1 which port should be alolwed for the windows machine to see internet
> 2 can i restrct it to something like :
> $iptables -A FORWARD -p TCP -i $LAN_IFACE -sport XX -dport XX -j
> ACCEPT
>
> in other words, allow the windows relevant port for accesing on the
> internet to be connected to the specific port of the firewall
You will not connect to any port on the firewall. The firewall will
route your packets through to the internet.
To access websites you need DNS (port 53/udp, sometimes tcp) to be able
to resolve the hostname of the website. Further, most websites use http
and/or https, ports 80/tcp and 443/tcp.
So, your ruleset would look like :
$ipt -P FORWARD DROP
$ipt -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
$ipt -A FORWARD -i $IF_LAN -o $IF_INET -m state --state NEW \
-p udp --dport 53 -j ACCEPT
$ipt -A FORWARD -i $IF_LAN -o $IF_INET -m state --state NEW \
-p tcp --dport 53 -j ACCEPT
$ipt -A FORWARD -i $IF_LAN -o $IF_INET -m state --state NEW \
-p tcp --dport 80 -j ACCEPT
$ipt -A FORWARD -i $IF_LAN -o $IF_INET -m state --state NEW \
-p tcp --dport 443 -j ACCEPT
But, this way you will not be able to browse a website that is not
hosted on a standard port (eg 81/tcp).
For more information about Netfilter, check out
http://iptables-tutorial.frozentux.net/iptables-tutorial.html.
Gr,
Rob
next prev parent reply other threads:[~2005-11-12 17:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-12 16:08 dhcp windows client port P theodorou
2005-11-12 17:08 ` Rob Sterenborg [this message]
2005-11-12 18:45 ` P theodorou
2005-11-12 19:36 ` dhcp windows client port (nfcan: addressed to exclusive sender for this address) Jim Laurino
-- strict thread matches above, loose matches on Subject: below --
2005-11-12 21:25 dhcp windows client port Gabriel
2005-11-12 23:27 ` P theodorou
2005-11-12 23:51 ` Tom Eastep
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=20051112171451.3D7E76ADE8@smtp.sterenborg.info \
--to=rob@sterenborg.info \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.