Add these line in existing firewall Or run a Script

General discussion about PLUC and Linux in Pakistan.
Post Reply
najeeb
Cadet
Posts: 1
Joined: Mon Jun 19, 2006 5:41 pm
Location: pakistan
Contact:

Add these line in existing firewall Or run a Script

Post by najeeb »

Internet Cable Network ( Selected Mac allow)

Firstly i want to drop all traffic afterthat i want to allow ip one by one.
Guide me i enter these line in existing Firewall or run in a script.

Drop All Traffice.

iptables -A INPUT -s 0/0 -j REJECT

-------------------------------------------------------------

Allow one by one all mac.

iptables -A INPUT -i eth0 -s 192.168.143.25 -m mac --mac-source
00-08-C7-39-CA-47 -j ACCEPT


Najeeb Ahmed
i am najeeb. want ot learn advace linux
nomankhn
Colonel
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm

Re: Add these line in existing firewall Or run a Script

Post by nomankhn »

najeeb wrote:Internet Cable Network ( Selected Mac allow)

Firstly i want to drop all traffic afterthat i want to allow ip one by one.
Guide me i enter these line in existing Firewall or run in a script.

Drop All Traffice.

iptables -A INPUT -s 0/0 -j REJECT

-------------------------------------------------------------

Allow one by one all mac.

iptables -A INPUT -i eth0 -s 192.168.143.25 -m mac --mac-source
00-08-C7-39-CA-47 -j ACCEPT


Najeeb Ahmed
Dear najeeb
#policy for the chains
#iptables --policy INPUT DROP
#iptables --policy OUTPUT DROP
#iptables --policy FORWARD DROP

first all those ips which u want than block them.


allow command
iptables -t nat -I PREROUTING -s 192.168.3.2 -i eth0 -j ACCEPT
iptables -t nat -I PREROUTING -s 192.168.3.3 -i eth0 -j ACCEPT

block all command
iptables -t nat -I PREROUTING -p icmp -s 192.168.3.0/24 -i eth0 -j DROP

Regards
Noman Liaquat Khanzada Rajput
Linux means productivity and fun.
NT means 'Not Today'.'XP' what else but 'Xtremely Painful.'
If Linux doesn't have the solution, you have the wrong problem
Linux is like a Red Indian tent: no Windows, no Gates, and an Apache inside!
Post Reply