Code: Select all
iptables -A block -m state --state NEW -i ! $EXTIF -j ACCEPT
Code: Select all
#!/bin/sh
#
echo " enabling forwarding.."
echo "1" > /proc/sys/net/ipv4/ip_forward
#outbound
EXTIF="eth0"
#inbound
INTIF="eth1"
echo " clearing any existing rules and setting default policy.."
iptables --flush
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F
## Create chain which blocks new connections, except if coming from inside.
iptables -X block
iptables -N block
iptables -A block -m state --state INVALID -j DROP
iptables -A block -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A block -m state --state NEW -i ! $EXTIF -j ACCEPT
iptables -A block -j DROP
## Jump to that chain from INPUT and FORWARD chains.
iptables -A INPUT -j block
iptables -A FORWARD -j block
iptables -A OUTPUT -j block
echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF"
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

from your first post too...msutton wrote:-A POSTROUTING -s 192.168.1.0/255.255.255.0 -j MASQUERADE
Code: Select all
-A POSTROUTING -s 192.168.1.0/255.255.255.0 -i $YOUR_INTERNAL_INTERFACE -j SNAT --to $YOUR_EXTERNAL_IP
wow. sounds like you've done some homework. it's nice to see people put a good amount of effort into there problems.msutton wrote:With further investigation using ethereal and tcpdump
Every time a packet is logged invalid the packet has a bad checksum.
corrupt data?msutton wrote:What causes a bad checksum?

makes sence to me.msutton wrote:The T1 uplink was on a 5 port linksys switch and I moved it to a Cisco Switch on its own VLAN and still have the problems ruling out the switch.
ya, that is why i suggested a reboot if possible.msutton wrote:The only thing after reading an enormous amount of info on the net is that the T1 router is corrupting the packet header when it sends it to me
i'm not sure. i wouldn't think a bad cable would behave like this. most bad cables i've seen ether don't work, or if you wiggle by the connector it starts and stops working. i guess i could see the shielding on the cable having a rip somewhere and noise being introduced, or some equipment the cable is run past is really misbehaving and radiating lots of noise, but i've never seen that. i seem to remember ethernet having a pretty high tolerance for noise, and think this is pretty unlikly. i'm not too sure on any of this though. i'd make a tin-foil helmet and ware it before approaching anything generating that much noise to interfere with ethernet.msutton wrote:or the uplink cat 5 is bad.
yep, rebooting the router before you get the packets is where my money is. again, good to see you have done your homework, but i should point out a correction. i'm pretty sure router's don't check the tcp checksum, they check the ip checksum. i don't think routers know or care about tcp/udp at all, just ip.msutton wrote:And the reason I believe it could be the T1 router, after reading the net this is what I understand, is that the router should do a tcp checksum by itself and if the packet is corrupt then it should not accept it and should ask for a retransmit. And since it is not asking for a retransmit and it passing it on and when it passes it on it adds its own IP header it could be corrupting.
yes, i second that. ethereal is your friend. if you don't have X11 installed on any of these boxes, i know it is possible to use tcpdump with some flags to capture the packets and then you can transfer the log to a computer with ethereal and open them for viewing from there. i don't remember how to do this, but you should be able to google for it.buzzin wrote:ethereal should let you inspect those checksums

i think it's pretty slim that the problem would be the network driver. i don't think network drivers know anything about the layers above ethernet. they may have some knowledge of ip, but i'm pretty sure they don't know about udp or tcp.buzzin wrote:maybe try another network card which uses a different kernel driver?
not really, you could check and make sure they are leaving there source host ok, if you had access to them, but i doubt they will be sending tcp packets with bad checksum. i've think i've seen tcp performance checkers somewhere... but again, i don't think that will help you.msutton wrote:Any other suggestions to fix the TCP checksum errors?