IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New A sample working chain.
#! /bin/sh

# Script for setting up IP Chaining.
# It will work whether or not PPP is actually up.

PATH=/sbin
ANY=0.0.0.0/0
HERE=$ANY
# ^^^ This probably needs to be changed when I get my real addresses.
# ... then again... perhaps not... :-)

# Setup

ipchains -P input DENY
ipchains -P output ACCEPT
ipchains -P forward ACCEPT

ipchains -F
ipchains -X

# PPP input chain
ipchains -N PPP
ipchains -A PPP -s 10.0.0.0/8 -j DENY -l
ipchains -A PPP -d 10.0.0.0/8 -j DENY -l
ipchains -A PPP -s 127.0.0.0/8 -j DENY -l
ipchains -A PPP -p tcp -d $HERE 1024: ! -y -j ACCEPT
ipchains -A PPP -p udp -d $HERE 1024: -j ACCEPT
ipchains -A PPP -p tcp -d $HERE http -j ACCEPT
# ipchains -A PPP -p tcp -d $HERE https -j ACCEPT
# ipchains -A PPP -p tcp -d $HERE ftp -j ACCEPT
ipchains -A PPP -p udp -d $HERE domain -j ACCEPT
ipchains -A PPP -p tcp -d $HERE domain -j ACCEPT
ipchains -A PPP -p tcp -d $HERE smtp -j ACCEPT
ipchains -A PPP -p tcp -d $HERE auth -j REJECT
ipchains -A PPP -p tcp -d $HERE ssh -s $WORK -j ACCEPT
ipchains -A PPP -p tcp -s $ANY ssh -j ACCEPT
ipchains -A PPP -p icmp -s $ANY -j ACCEPT
ipchains -A PPP -p tcp -d $HERE 1024: -s $ANY ftp-data -y -j ACCEPT
ipchains -A PPP -j DENY -l

# input chain
ipchains -A input -i ppp+ -j PPP
ipchains -A input -i eth+ -j ACCEPT
ipchains -A input -i lo -j ACCEPT
ipchains -A input -l

# forwarding
ipchains -A forward -s 10.0.0.0/8 -d 10.0.0.0/8 -j ACCEPT
ipchains -A forward -s 10.0.0.0/8 -i ppp+ -j MASQ

# output
ipchains -A output -i eth+ -j ACCEPT
ipchains -A output -i lo -j ACCEPT
ipchains -A output -i ppp+ -p tcp -d $ANY 137:139 -j DENY



This should get you started. I know I'm being somewhat lazy :-) in not just explaining things. You've got the basic idea, but I think the forward chain needs to default to ACCEPT.

As regards saving them, I would actually suggest you tinker with the rules directly with the ipchains command, and then use /etc/init.d/ipchains save to actually save it. Remember to use chkconfig to make sure the IP chains are loaded at bootup!

As regards email, you probably want a combination of fetchmail and something else. Normally I would recommend [link|http://www.courier-mta.org/|Courier], but I've had trouble with Fetchmail delivering to Courier and no-one associated with either product was interested in investigating it. (This is a bit of a shame as Courier includes an IMAP server, a POP3 server and a webmail server.)

Wade.

"Ah. One of the difficult questions."

New Re: A sample working chain.
Well, you've got some extra stuff that I don't, for security reasons... but wrt masq, that's exactly what I have. I also tried it with ipchains -P forward ACCEPT, but that didn't make any difference... and I didn't think it would because there are a lot of websites that DO work... it's just a significant number of them that don't. At any rate, it's working now with squid as a proxy, exim as an smtp forwarder, and other protocols like telnet, ftp, pop, nntp, etc working just fine via nat. Personally, I think it's the provider... there have been three NAT engines on that network now (linux, warp, and windows based) and ALL of them do the same thing... which I believe means it's not them doing it at all. I mean, I've used the OS/2 solution (safefire) for well over a year on my home network on adsl, and it's always worked fine... I've seen wingate in action on plenty of networks, and I have little doubt that the linux NAT can handle a little http without breathing hard, but my home provider is not the same outfit as these guys have... and since we're talking about Ma Bell here, it wouldn't surprise me in the least if they were playing games... and esp. considering that it's very clear that have things configured in a similar manner for their smtp server (only the router can connect... masqed packets get denied... not rejected, denied) I'm about 99% sure it's them. I'm not sure what it is about these sites that trip their firewalls... but trip them it seems to do. As soon as there's dynamic content on the site, the jig is up. Either they're doing it on purpose or they have some VERY badly configured proxies in there somewhere...
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Laval Qu\ufffdbec Canada                   [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
     Debian Linux Question about modules for ethernet - (jake123) - (24)
         Re: Debian Linux Question about modules for ethernet - (pwhysall) - (23)
             Re: Debian Linux Question about modules for ethernet - (jake123) - (22)
                 Re: Debian Linux Question about modules for ethernet - (pwhysall) - (4)
                     Re: Debian Linux Question about modules for ethernet - (jake123) - (3)
                         Re: Debian Linux Question about modules for ethernet - (pwhysall) - (2)
                             Re: Debian Linux Question about modules for ethernet - (jake123) - (1)
                                 You never will have... - (folkert)
                 what happens when you do ifconfig -a - (boxley) - (16)
                     Re: what happens when you do ifconfig -a - (jake123) - (15)
                         is there a lan0 in /dev ? - (boxley) - (14)
                             There won't be. - (pwhysall) - (13)
                                 Re: There won't be. - (jake123) - (11)
                                     Just give it an address that doesn't interfere - (scoenye) - (10)
                                         Re: Just give it an address that doesn't interfere - (jake123) - (9)
                                             Too many choices - (scoenye) - (7)
                                                 Things are beginning to come together... - (jake123) - (6)
                                                     Some hints. - (static) - (5)
                                                         Re: Some hints. - (jake123) - (4)
                                                             Yet more hints. - (static) - (3)
                                                                 Re: Yet more hints. - (jake123) - (2)
                                                                     A sample working chain. - (static) - (1)
                                                                         Re: A sample working chain. - (jake123)
                                             When I was using Linux to make pppoe connections . . - (Andrew Grygus)
                                 is that across the board linux? no hme0 or sme0? -NT - (boxley)

Debian is Sex.
45 ms