Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Tobias Andresen <tobiasarp@gmx.de>
To: Pascal Hambourg <pascal@plouf.fr.eu.org>, netfilter@vger.kernel.org
Subject: Re: NTP forwarding
Date: Sun, 6 Mar 2016 22:16:02 +0100	[thread overview]
Message-ID: <56DC9E12.6050705@gmx.de> (raw)
In-Reply-To: <56DC9631.7010702@plouf.fr.eu.org>

Am 06.03.2016 um 21:42 schrieb Pascal Hambourg:
> Tobias Andresen a écrit :
>> i have following network structure:
>>
>>
>>       NTP-Server (62.214.6.29)
>>                 |
>>                 |
>>                 |
>>        (eth0: 10.0.0.95)
>>          Embedded board
>>      (eth1: 192.168.31.95)
>>                 |
>>                 |
>>                 |
>>          Ethernet-Switch
>>           |        |    |
>>           |        |    |
>>          PC1       |   PC3 (192.168.31.98)
>> (192.168.31.96)  |
>>                    |
>>                   PC2
>> (192.168.31.97)
>>
>>
>> The 3 PCs shall be able to connect to the NTP server (62.214.6.29)
>> to update their time but i cannot figure out how to configure the
>> iptables rules
>> on the embedded board to achieve this.
> Why do you think you need iptables rules ? Isn't plain routing enough ?
The PCs should only be able use NTP (Port 123). They should not be able 
tohave full access (i.e. internet, ...)
>
>> I have tried to forward port 123 but it does not work.
> This statement does not contain any useful information. It does not
> describe what you did and what happened.

I tried following rule for one PC:

iptables -t nat -A PREROUTING -p udp --dport 123 -j DNAT 
--to-destination 192.168.31.96:123
iptables -t nat -A POSTROUTING -p udp --dport 123 -j MASQUERADE

I know this would work only for one client but it was for testing purposes.




> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2016-03-06 21:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-05 14:15 NTP forwarding Tobias Andresen
2016-03-06 20:42 ` Pascal Hambourg
2016-03-06 21:16   ` Tobias Andresen [this message]
2016-03-06 21:40     ` Pascal Hambourg
2016-03-07  7:24       ` Tobias Andresen
2016-03-07 19:33         ` Pascal Hambourg
2016-03-07  3:49     ` Remzi AKYÜZ
2016-03-07  7:26       ` Tobias Andresen
2016-03-07  9:24         ` Vigneswaran R
2016-03-07 10:05         ` Remzi AKYÜZ
2016-03-08 11:54 ` Karol Babioch

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=56DC9E12.6050705@gmx.de \
    --to=tobiasarp@gmx.de \
    --cc=netfilter@vger.kernel.org \
    --cc=pascal@plouf.fr.eu.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