Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Chris Partsenidis" <Chris@firewall.cx>
To: security@grossepointe.com, netfilter@lists.netfilter.org
Subject: Re: Allowing select IPs access to a single port
Date: Sun, 9 Feb 2003 17:58:48 +0200	[thread overview]
Message-ID: <000f01c2d054$24171d00$0100a8c0@admin> (raw)
In-Reply-To: 020901c2cfc7$9d1955c0$52453e44@cc292729a

[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]

Assining the service your remote hosts are trying to access are on the firewall box and its a service that uses the TCP transport protocol, you could try something like the following:


iptables -A INPUT  -s remoteip -p tcp -d yourfirewallip --dport 3306 -j ACCEPT

If the service is on another pc on the internal network:

iptables -A PREROUTING -t nat -s remoteip -p tcp -d yourfirewallip --dport 3306 -j DNAT --to internalhostip

and in the case your internal service is running on a different port, e.g 4000:

iptables -A PREROUTING -t nat -s remoteip -p tcp -d yourfirewallip --dport 3306 -j DNAT --to internalhostip:4000

Hope this helps. I'll soon be covering IPTables on my website so you can check in a few weeks times, hopefully I'll have it posted by then:
www.Firewall.cx

Cheers,
__________________________
Chris Partsenidis.
Systems Network Administrator
Email: Chris@firewall.cx
http://www.firewall.cx  
__________________________
  ----- Original Message ----- 
  From: security@grossepointe.com 
  To: netfilter@lists.netfilter.org 
  Sent: Sunday, February 09, 2003 1:12 AM
  Subject: Allowing select IPs access to a single port 


  Hello, 

  What would be the best way to only open port 3306 to 1 or 2 IPs for remote connection? I was hoping someone could provide an iptable command that would achieve this.

  I have tried a few things but I am a newbie and have yet to figure this one out.  Any resources or assistance would be appreciated.

  Thanks in advance. 

  Doug


[-- Attachment #2: Type: text/html, Size: 3421 bytes --]

      reply	other threads:[~2003-02-09 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-08 23:12 Allowing select IPs access to a single port security
2003-02-09 15:58 ` Chris Partsenidis [this message]

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='000f01c2d054$24171d00$0100a8c0@admin' \
    --to=chris@firewall.cx \
    --cc=netfilter@lists.netfilter.org \
    --cc=security@grossepointe.com \
    /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