Operating System - Linux
1753277 Members
4731 Online
108792 Solutions
New Discussion юеВ

Re: how to configure Firewall

 
Guna_2
Regular Advisor

how to configure Firewall

Dear all

I am having 2 ip address in my linux box. I want to configure my firewall in such a way that, If telnet request is coming from one setof ip address it should accept and if it is from another set of ip address it should deny.

Is it possible with linux basic firewall

If possible please tell me how to configure that.


Thanks And Regards,
Guna
3 REPLIES 3
g33k
Valued Contributor

Re: how to configure Firewall

if basic firewall for you is IPTABLES.

Then its easy.

iptables -A INPUT -d 192.168.0.5 --destination-port 23 -j ACCEPT

allows telnet on ip address 192.168.0.5 or you can use -i eth0 if the interface is eth0.

You should you use DROP for deny.

But it depends how you iptables is set now...

More info here
http://www.linuxguruz.com/iptables/howto/
Wouter Jagers
Honored Contributor

Re: how to configure Firewall

Hiya,

Also, you could check how to use the hosts.allow and hosts.deny files (man, google).

But most of all, for some level of security, I would recommend using ssh and disabling telnet alltogether ;-)

Cheers
an engineer's aim in a discussion is not to persuade, but to clarify.
Wouter Jagers
Honored Contributor

Re: how to configure Firewall

Sorry, I guess I misread your question. You probably want to accept connections to one of your IPs and not connections the other. Forget about hosts.allow and hosts.deny then (well, don't forget, but it won't help you here).

My advice on ssh is still valid, though.

Cheers
an engineer's aim in a discussion is not to persuade, but to clarify.