Add these line in existing firewall Or run a Script

General discussion about PLUC and Linux in Pakistan.

Add these line in existing firewall Or run a Script

Postby najeeb » Fri Jun 23, 2006 11:11 pm

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
najeeb
Cadet
 
Posts: 1
Joined: Mon Jun 19, 2006 5:41 pm
WLM: najeebjutt@hotmail.com
Yahoo Messenger: najeeb_jutt@yahoo.com
AOL: none
Location: pakistan

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

Postby nomankhn » Sat Jun 24, 2006 12:26 pm

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!
nomankhn
Colonel
 
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm


Return to “%s” General

Who is online

Users browsing this forum: No registered users and 3 guests

cron