LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
forward ssh


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

________________________|-----others
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 xxx.xxx.xxx.xxx --dport 0:1024 -j DROP


i've decided to change that rule in:

--------Start-of-file-----------------
.
.
/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 xxx.xxx.xxx.xxx --dport 0:21 -j DROP
/sbin/iptables -A FORWARD -p TCP -s 0/0 -d xxx.xxx.xxx.xxx --dport 23:1024 -j DROP
/sbin/iptables -A FORWARD -p TCP -s 0/0 -d xxx.xxx.xxx.xxx --dport 22 -j ALLOW
.
.
-----------end-of-file-------------
that will work?
 
Old 05-01-2005, 02:41 PM   #2
nhs
Member
 
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
It should but why not use

Code:
iptables -A INPUT -p tcp --dport 22 -j DROP
iptables -A FORWARD -p tcp -d xxx.xxx.xxx.xxx --dport 22 -j ACCEPT
iptables -A FORWARD -p tcp -d xxx.xxx.xxx.xxx --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 xxx.xxx.xxx.xxx or any ports other than 22 on the gateway.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:51 AM.

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