LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Assign port dedicatedly against an interface ! (https://www.linuxquestions.org/questions/linux-newbie-8/assign-port-dedicatedly-against-an-interface-803456/)

shipon_97 04-22-2010 01:48 AM

Assign port dedicatedly against an interface !
 
Dear Friends ,
I am using RHEL 5 . In my Linux Box i have two Lan cards (eth0 and eth1) .

"eth0" is connected with network 192.168.10.0 and "eth1" is connected with network 192.168.11.0 . Both Network are inter connected via routing .

Now I want a situation where , I want to dedicatedly assign some port numbers against a lan card . Like eth0 will be assigned for ssh (22) and eth1 is assigned for telnet (23) . so that ,

when a user connect to 22 port then he/she is connected to the server through eth0 , and when a user connect 23 port then he/she is connected to the server through eth1.

Is it possible to do using iptables or other ?

Waiting for kind reply ... ...

jschiwal 04-22-2010 02:11 AM

You can easily have telnet (I wouldn't recommend running the telnet server) or ssh blocked on one or the other of the interfaces. Perhaps one network is trusted and the other isn't. It doesn't make sense to allow both networks but use a particular interface because that isn't how the user is connecting.

chrism01 04-22-2010 02:56 AM

For sshd, try ListenAddress option http://www.openbsd.org/cgi-bin/man.c...nfig&sektion=5.
You can also ctrl both sshd and telnetd via TCP Wrappers ie /etc/hosts.allow, hosts.deny


All times are GMT -5. The time now is 03:25 AM.