Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-30-2005, 05:35 AM   #1
LQ Newbie
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
forward ssh

i have one router to configure (freebsd) with real ip
before this comp i have one gateway (fedora) (for lan)
i need ssh connection to BSD, but linux gateway block it

internet-->LINUX GATEWAY |
________________________|-my BSD router (real ip)

in ip_tables (linux) i have rules:
/sbin/iptables -A INPUT -p TCP -s 0/0 -d 0/0 --dport 22 -j DROP
/sbin/iptables -A FORWARD -p TCP -s 0/0 -d --dport 0:1024 -j DROP

i've decided to change that rule in:

/sbin/iptables -A INPUT -p TCP -s 0/0 -d 0/0 --dport 22 -j DROP
/sbin/iptables -A FORWARD -p TCP -s 0/0 -d --dport 0:21 -j DROP
/sbin/iptables -A FORWARD -p TCP -s 0/0 -d --dport 23:1024 -j DROP
/sbin/iptables -A FORWARD -p TCP -s 0/0 -d --dport 22 -j ALLOW
that will work?
Old 05-01-2005, 02:41 PM   #2
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
It should but why not use

iptables -A INPUT -p tcp --dport 22 -j DROP
iptables -A FORWARD -p tcp -d --dport 22 -j ACCEPT
iptables -A FORWARD -p tcp -d --dport 0:1024 -j DROP
As that is (to my mind) cleaner. Also I can't help wondering why you're not blocking UDP, the high ports on or any ports other than 22 on the gateway.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH port forward problem idsdown Linux - Networking 2 11-25-2005 12:47 AM
SSH forward (tunnel) overhead ? michaelsanford Linux - Networking 2 07-31-2005 05:58 AM
IPTABLES Forward ssh session wkuk Linux - Security 2 05-21-2004 07:41 AM
ssh port forward failure harmster Linux - Networking 2 03-08-2004 06:46 AM
port forward over ssh bedwardj Linux - Security 1 06-26-2001 04:07 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration