LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 02-18-2005, 03:13 AM   #1
borisation
LQ Newbie
 
Registered: Feb 2005
Posts: 1

Rep: Reputation: 0
Iptables thingy


Hey guys.. I just updated the firmware of a Linksys router to a hacked one. And I can use iptables to add blocking rules to my network, but the router lacks the feature to block a pc's total internet access save a few domains. So, basically, what I want to do is to block internet access totally to 1 pc except for 2 domain names.. I'm just a newbie at iptables, so could anyone give me a lead ?
 
Old 02-18-2005, 06:43 AM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
$INTIF = eth0

# Flush the chains
$IPTABLES -F INPUT
$IPTABLES -F OUTPUT
$IPTABLES -F FORWARD

#drop all traffic
$IPTABLES -A INPUT -i $INTIF -p tcp -j drop
$IPTABLES -A INPUT -i $INTIF -p udp -j drop
$IPTABLES -A INPUT -i $INTIF -p tcp -j drop

# Allow your 2 destinations
$IPTABLES -A INPUT -i $EXTIF -s 0.0.0.0 -d www.site1.com -j ACCEPT
$IPTABLES -A INPUT -i $EXTIF -s 0.0.0.0 -d www.site1.com -j ACCEPT


Although I'm not sure you can allow based on a DNS name. I tried to block using a DNS entry, and it wasn't quite succussful. What I've typed would have to be running on the machine you want to restrict
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting there TAR.GZ thingy jymmi Linux - Newbie 9 03-30-2005 11:16 AM
Network thingy Pedroski Linux - Hardware 5 06-13-2004 12:00 PM
i solved the pointing thingy Longinus Programming 5 02-28-2004 04:20 AM
ISP thingy flipboi Linux - Newbie 9 10-24-2003 11:43 PM
< thingy nero64 Linux - Newbie 1 11-28-2002 08:39 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration