LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 09-17-2003, 03:10 PM   #1
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
only allowing web browsing accross the linux box


hello,

i have a linux box set up thats acting as a router type device for 5 workstations on my lan, on one particular host i want to disable everything but web browsing from this host.

so a thought i would add the following lines to my iptables:

-A INPUT -s 10.0.0.2 -p tcp --dport ! 80 -j DROP
-A INPUT -s 10.0.0.2 -p tcp --dport 80 -j ACCEPT

if i put the above lines into my blank input table it blocks everything and does not even allow web trafic through.

i could not remember what protocol web browsing was so i tried both and still no results

does any one have any ideas?

Please Help
 
Old 09-17-2003, 03:17 PM   #2
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
I would setup the rule earlier then that on the host, remove the inputs.

iptables -t nat -A PREROUTING -s 10.0.0.2/255.0.0.0 -p tcp --dport ! 80 -j DROP
 
Old 09-17-2003, 03:43 PM   #3
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
ah, thanks for that

now the packet numbers are going up

the only thing is i notice that the msn messenger thing is still working on there i know it runs over port 1863 but the packet numbers do not go up when a message is sent, which i thought it would ( ? )

i'll have to play with the rules, but its working now but:

Thanks


i presume then there is an order in which the iptables are approched by the kernel, is there a how to availible that details this?


thanks once again

antken
 
Old 09-17-2003, 03:53 PM   #4
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
I don't remember there being an 'howto' but you are amoung many that are trying to block msn messenger.

I presume a better way of blocking it could be to setup a http proxy perhaps.

The Tables I believe go in this order.

Nat

Mangle

Default

And the chains go in descending order from --list

Try using email on that blocked machine to make sure all traffic is killed. Secondly you could always block access to msn's login server as well

iptables -t nat -A PREROUTING -s 10.0.0.2 -d msnIP -j DROP
 
Old 09-17-2003, 04:14 PM   #5
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
i found this page:

http://www.venkydude.com/articles/msn.htm

it details that msn connects to messenger.hotmail.com on port 1863, the msn server then in plain text directs the client to connect to another server, and then starts communication in plain text ( )

its pretty useful, perhaps i could use snort against it in some way


thanks for your help, i seem to have pretty much have sealed it up and only web browsing is going on ( oh and dns lookups are required for the browser i nealy forgot )


thanks
 
Old 09-17-2003, 04:31 PM   #6
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
Then block access to messenger.hotmail.com via ip through prerouting on that machine and your gold.
 
Old 09-17-2003, 04:41 PM   #7
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
i have done,

and i have blocked the outgoing port ( 1863 ) from that machine as an extra, as you say 'its gold'
 
  


Reply



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
Linux terminal Server for windows client web browsing? hawkpaul Linux - Enterprise 6 09-24-2005 06:04 PM
Blocking port 80 on NAT and allowing browsing thru squid krishvij Linux - Networking 2 07-19-2005 05:10 AM
Router and Linux (Slow web browsing) Fixed! User_Program Yoper 10 12-24-2004 03:35 AM
SSH to my Fedora Core 2 box - Allowing just one IP!!! jpierre70 Linux - Security 4 07-30-2004 12:06 PM
Browsing Samba share from another linux box FiveFlat Linux - Software 3 01-13-2004 02:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:32 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
Open Source Consulting | Domain Registration