Re: Iptables: port 22 open only for my IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Khan pravi:

Hello,

I am total beginner to Linux and I'm trying to learn iptables basics. I would like to learn how to close all ports but 80, 20, and that ports 22 and 10000 will be open only to my IP address.

How can I do that.

TNX!


Close all ports:
iptables -P INPUT DROP

Just create a chain named "myself":
iptables -N myself
iptables -A myself -m mac -s xxx.xxx.xxx.xxx --mac aa:bb:cc:dd:ee:ff -j ACCEPT


and then for each port, eg. port 80:
iptables -t filter -A INPUT -p tcp -s 0/0 -d $NET --dport 80 -j myself

--Sasa

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux