🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.linux.networking
Article #400

Re: IPTables vs. DNS (or : iptables doesn't change sourceport when MASQ'ing)

#400
From: Koen Van de Velde
Date: Fri, 03 Jan 2003 17:06
54 lines
3478 bytes
On Fri, 03 Jan 2003 16:32:23 +0000, John Armstrong
<ja@ggrove.swinternet.co.uk> wrote:

Hi John,
thanks for your response

[snip again]
>
>Assuming bind is being used, has /etc/named.conf been altered? My copy
>has the following comment:
>         * Previous versions of BIND always asked
>         * questions using port 53, but BIND 8.1 uses an unprivileged
>         * port by default.
>         */
>        // query-source address * port 53;
>
it's not Bind, it's M$ ;-( (ssstt, don't tell anyone) 
but it's ok for me that (on the local network) it acts as a dns-server
and therefor sents its requests to other dns-servers FROM (and to)
port 53.

>>
>>IN SHORT : 
>>Why doesn't the MASQ-module of iptables translate the portnumber when
>>it's MASQ'ing (and ipchains did !) ??
>man iptables :
> --to-ports port[-port]
>  This  specifies  a  range of source ports to use, overriding the
>  default SNAT source port-selection heuristics (see above).  This
>  is only valid if the rule also specifies -p tcp or -p udp.
I think this one is more used for redirection. eg: incomming packets
on port 8000 on external interface of router should be redirected to
other internal machine on port 80 (then the --to-ports 80 should be
used). As described in 6.2.1 of the NAT-howto.

>>First I thought it wasn't doing this for DNS-request only, but taking
>>a closer look, it doesn't do this for any service.
>>So if two computers in my LAN start an http-request from their local
>>port 1026, my linux-router/firewall will sent them both out with the
>>same source-port.  I'm wondering what kind of effect this wil have !
>Not an expert, but presumably the de-masq'ing process sorts it out and
>sends the reply packets back where they should go. Not sure how it
>would work if both requests were going the the same destination
>though.

I thought it would give each outgoing packet a new unique source-port
(let's say: starting from 61000). When the packets come back, it can
check this port, look it up in it's NAT-table, and forward the packet
to the original requester. As far as I know, this is how ipchains
worked.
Now it seems that iptables is doing it different, Or I did something
wrong with my configuration, Or I'm using a buggy version of iptables.

K.
Technical Details
Message-ID: <3e15c063.2081842881@News.CIS.DFN.DE>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!d5771a7d.kabel.telenet.BE!not-for-mail
References: <3e15b63e.2079245577@News.CIS.DFN.DE> <kceb1vkrt1c2c1hl5gmnadtsjtlq1mlmqu@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 100a19,1167933813471c51
X-Google-Attributes: gid100a19,public
X-Google-Thread: 102510,1167933813471c51
X-Google-Attributes: gid102510,public
X-Google-Thread: 10669a,1167933813471c51
X-Google-Attributes: gid10669a,public
X-Google-ArrivalTime: 2003-01-03 09:06:10 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!d5771a7d.kabel.telenet.BE!not-for-mail
From: nospam.koen.vdvelde@advalvas.be (Koen Van de Velde)
Newsgroups: comp.os.linux.networking,nl.comp.os.linux.netwerken,be.comp.os.linux
Subject: Re: IPTables vs. DNS (or : iptables doesn't change sourceport when MASQ'ing)
Date: Fri, 03 Jan 2003 17:06:20 GMT
Lines: 54
Message-ID: <3e15c063.2081842881@News.CIS.DFN.DE>
References: <3e15b63e.2079245577@News.CIS.DFN.DE> <kceb1vkrt1c2c1hl5gmnadtsjtlq1mlmqu@4ax.com>
NNTP-Posting-Host: d5771a7d.kabel.telenet.be (213.119.26.125)
X-Trace: fu-berlin.de 1041613568 12373374 213.119.26.125 (16 [84932])
X-Newsreader: Forte Free Agent 1.11/32.235