Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-12-2004, 08:44 AM
|
#1
|
Member
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49
Rep:
|
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,
|
|
|
11-12-2004, 08:50 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
11-12-2004, 09:01 AM
|
#3
|
Member
Registered: Nov 2004
Location: East Side
Distribution: Red Hat
Posts: 49
Original Poster
Rep:
|
yeah well I just gave port 21 as an example,
how do I do it for other ports.
PS It only has one NIC
|
|
|
11-12-2004, 06:35 PM
|
#4
|
LQ Guru
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 05:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|