Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I've some questions maybe somebody can help me. I'am working on a firewall script in bas(os: linux) and i want to know which are the codes for this questions ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2003
    Location
    amsterdam
    Posts
    3

    Problems with Bashcode


    Hi,
    I've some questions maybe somebody can help me.
    I'am working on a firewall script in bas(os: linux) and i want to know which are the codes for this questions

    1i want to filter a various number of ports
    2.for this ports there must be given a set of ip's which have unlimited access.
    3.i want to filter ssh separately(whit his own set of ip's)
    4.the machine should not answer any pings,icmp timestamps and trace routes.[/list]

    Many Thanks

    Martin (student Information Technology)


  2. #2
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416
    Have a look at the man pages for iptables or check tldp.org
    I am on a journey to mastering Linux and I got a bloody long way to go!!!

  3. #3
    Just Joined!
    Join Date
    Oct 2003
    Location
    amsterdam
    Posts
    3
    I did read the man pages but i need some specific help for mine questions!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, one possible solution is a setup such as this:
    Code:
    iptables -N CHECK2
    
    iptables -A CHECK2 -s $IP1 -j RETURN
    ...
    iptables -A CHECK2 -s $IPn -j RETURN
    iptables -A CHECK2 -p tcp -j REJECT --reject-with tcp-reset
    iptables -A CHECK2 -j REJECT
    
    iptables -A INPUT -p tcp --dport $PORT1 -j CHECK2
    ...
    iptables -A INPUT -p tcp --dport $PORTn -j CHECK2
    
    iptables -A INPUT -p icmp -j DROP
    I would like to beg of you, though, don't drop ICMP messages. I find that nothing is more disturbing than hosts not answering to ICMP messages.

  6. #5
    Just Joined!
    Join Date
    Oct 2003
    Location
    amsterdam
    Posts
    3
    Many THX and thx for the hint to never drop icmp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •