LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-12-2004, 07:44 AM   #1
st3reo
Member
 
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49

Rep: Reputation: 15
port redirecting


Hey

I have a red hat box and I have 3 ips on eth0
If you for example try to connect to port 21 if you connect to ip1, ip2 or ip3
they all work so you end up in the same place but I want to set it so that connections to port 21 to be permited only on ip1 and if you try to connect to ip2 or ip3 to deny connection to the port
Hope I`ve been pretty clear,
Can anyone help me?

Thanks a lot,
 
Old 11-12-2004, 07:50 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you can either use a firewalll on all NIC's and openly open the port on the single NIC you want, or more easily you should be to configure your ftp server to only listen on either 1) that interface or 2) the subnet applicable to that NIC.
 
Old 11-12-2004, 08:01 AM   #3
st3reo
Member
 
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49

Original Poster
Rep: Reputation: 15
yeah well I just gave port 21 as an example,

how do I do it for other ports.

PS It only has one NIC
 
Old 11-12-2004, 05:35 PM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
As acid_kewpie mentioned you can use a firewall, for example:
Code:
/sbin/iptables -P INPUT DROP
/sbin/iptables -A INPUT -p tcp -d <ip1> --dport 21 -j ACCEPT
 
  


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
redirecting port on my PC patcito Linux - Networking 3 10-20-2005 04:27 PM
Port Redirecting Problem with Transparent Proxy landuchi Linux - Networking 15 11-08-2004 07:01 AM
Port redirecting English_Man Linux - Networking 3 03-09-2004 07:40 AM
Redirecting Half_Elf Linux - Networking 2 09-04-2002 10:51 PM
about port redirecting cmardhekar Linux - Newbie 1 09-13-2001 07:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:43 PM.

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