Re: Block martians with source address

From: Kalevi Nyman (
Date: 05/31/04

  • Next message: Slack Traq: "Re: Block martians with source address"
    Date: Mon, 31 May 2004 19:21:28 +0200
    To: Bjørn Rasmussen <>

    Add commands below to your table by wrting them on the command line and
    then use the command

    iptables-save > /etc/sysconfig/iptables

    or where you keep your table

    1. iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    2. iptables -A INPUT -m state --state NEW -i eth0 -s -j DROP

    1. If the state of a packet is a response to existing connection or
           accept the package. Else drop. If an application on a remote machine
            wants to exechange packets with your computer it is allowed to do so
            if you initiated the communication and only then.

    2. An explicit command to drop any incoming packet that has the source

    Kalevi Nyman

    Bjørn Rasmussen wrote:
    >I've firewall connected to the Internet via an ISDN-line.  Sometimes
    >martians arrive from the Internet with source address  I want
    >to block these packets, but I don't find any way to set up the rules to
    >accomplish this.
    >Normally I use "fwbuilder" to set up my rules, but since the martians
    >were not blocked by the spoofing-rules generated by "fwbuilder", I tried
    >a simple test using iptables-commands directly.
    >I added these rules as the only ones to the input chain on my
    >iptables -A INPUT  -i eth0 -s -j LOG
    >iptables -A INPUT  -i eth0 -s -j DROP
    >iptables -A INPUT  -i eth0 -s -j LOG
    >iptables -A INPUT  -i eth0 -s -j DROP
    >>From a client on my LAN, I used the command "nmap -e <LAN-interface on
    >client> -S <ip-addr. of firewalls LAN-interfac>" to spoof the
    >localhost address.
    >The kernel on the firewall logs these packets as martians which it
    >should do, but my rules will not log or block these packets.  Anybody
    >who knows how to do it?  Is it possible?  I guess there are situations
    >were malicious persons could at least perform a DoS-attack?
    >Best regards
    >Bjørn Rasmussen

  • Next message: Slack Traq: "Re: Block martians with source address"

    Relevant Pages

    • Re: Cant ping router.
      ... default ECHO_RESPONSE packets. ... Ping response is just the same: ... the Unix ping command. ... the 'route change' command I gave you explicitly ...
    • Re: nmap Discover others question
      ... Note the "ADD" command in the example. ... Manipulates network routing tables. ... I'm well aware of the syntax of the "route" command shipped with ... Your example command defines that packets with a destination address ...
    • exec tcpdump and tethereal
      ... I was looking at using tcpdump and tethereal from a script to read ... packets from a capture file. ... I tried to do this with the exec command ...
    • Re: ncgi issue with binary file data
      ... Is the above command line specifically what you'd recommend? ... ASCII. ... The -s0 avoids truncating packets to a stupid default limit (IP ... You may also play with [encoding system] to view or change Tcl's idea ...
    • Re: Port forwarding with iptables ???
      ... I did run those at the command line, but I didn't get any errors. ... I've tried just about any variant of those rules I could find on the Web or ... to see if any packets even were picked up by this ... Every time I sent a request to the port in question it ...