1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SMTP Firewall

Discussion in 'HyperWRT Firmware' started by chaslchasl, Feb 4, 2005.

  1. chaslchasl

    chaslchasl Network Guru Member

    Total Newbie here. Thanks listers for all the help so far!! Can someone point me in some direction. Maybe a Linux server HOWTO or another thread here or something.

    I am looking to build an iptables rule for use on the HyperWRT wrt56g that will only ALLOW smtp traffic from a certain range of ip addresses, like: - that's through ( - all seven Class C blocks - that's through ( - one class C block

    Thought I may have been close here:

    /sbin/iptables -A FORWARD -s -p smtp -j ACCEPT
    /sbin/iptables -A FORWARD -s -p smtp -j ACCEPT

    but not sure. Any help apprc'd.

    Thanks 1 million
  2. chaslchasl

    chaslchasl Network Guru Member

    Here's a solution

    For those of you who may have googled in here:

    Using HyperWRT 2.0

    Use the http GUI to set up port forwarding to your local server

    Then, Use Command shell in http>Administration to grab the line number of the preceeding action by typing:
    /usr/sbin/iptables -vL

    Use http>Administration>Firewall button to add this script

    /usr/sbin/iptables -R FORWARD XX -s -d -p tcp --dport 25 -j logaccept

    Where XX is the FORWARD chain line no. you got from step 2 above.

    This says "Replace Line no. XX in FORWARD chain to forward port 25 tcp traffic from INTERNETip to LOCALip" and log

    Pretty much just a mod to the original linksys, except not forwarding from "anywhere".

Share This Page