LinuxQuestions.org
Review your favorite Linux distribution.
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 11-04-2002, 12:39 PM   #1
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
clearing up ipchains rules


hi,

i have just taken on yet another linux box ( bringing me to a grand total of 5 )

its setup is as follows: ( sorry about my ascii drawings )


{internet}
|
|
|
LINUX box -------- local clients ( as router )
|
|___win9x clients ( samba )


basically the ipchains rule book is over flowing with junk and its slowing it down so i want to clear it up.

i have flushed every thing out and i am now rebuilding

i want to block samba access to the box from outside will this line work:

Code:
ipchains -A input -s ! 192.168.0.0/16 -d 0/0 139 -p tcp -j DENY
what do you think? would that be ok?


thanks
antken

Last edited by antken; 11-04-2002 at 12:40 PM.
 
Old 11-04-2002, 01:15 PM   #2
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
How many network cards are on this? You should have a minimum of two (you can do it with one but I do not recommend it)

Then simply block tcp 135-139 on the external (WAN) interface.
 
Old 11-04-2002, 01:29 PM   #3
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
hi,


yes there are two nics in the box eth0 is the internal and the external nic is eth1

the internal ip is 192.168.0.0/16



thanks
 
Old 11-04-2002, 01:55 PM   #4
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
ok so iptables -I FORWARD 1 -p tcp -d 0/0 135-139 -j DENY
 
Old 11-04-2002, 02:14 PM   #5
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
would this work on an ipchains if i changed a few things around?

what does the '1' mean after the FORWARD ?
 
Old 11-04-2002, 02:28 PM   #6
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
It inserts the rule before the 1st entry in the FORWARD chain. I do that because if you have a masq line there you'll skip it.

I don't do it in INPUT or OUTPUT because this blocks packets going either way with one rule.
 
Old 11-04-2002, 03:26 PM   #7
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
For the ipchains syntax have a look here...

http://www.linux.org/docs/ldp/howto/IPCHAINS-HOWTO.html

Regards,
Peter
 
  


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
Clearing out space iain.ross SUSE / openSUSE 2 01-26-2005 10:21 PM
IPChains Rules parikrama Linux - Security 9 03-19-2004 09:23 PM
ipchains forwarding rules scheidel21 Linux - Networking 0 01-20-2004 07:37 AM
Clearing the screen in C++ qcoder Programming 7 11-29-2003 11:03 AM
Viruses, ipchains, dynamic rules, rules with regular expressions marktaff Linux - Security 2 09-25-2001 04:01 AM

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

All times are GMT -5. The time now is 08:38 PM.

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