Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, So to begin, we are going to have a LAN party (just with some friends) on doomsday (21 december). So the plan is, that i install a Server (wich ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    8

    Linux Firewall/Proxy/ ???


    Hello,

    So to begin, we are going to have a LAN party (just with some friends) on doomsday (21 december). So the plan is, that i install a Server (wich i have) between the modem and the router. (Yes the server has 2 network ports)

    Now i want to block all internet connection from a certain time. I just don't know how to do it.

    Any help?

    Erates

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    You could read up on what rules do and how to use them with this TUTORIAL

    Here is a very simple setup that will allow all connections out and only established connection back in.

    Code:
    iptables -P INPUT DROP
    iptables -P OUTPUT DROP
    iptables -P FORWARD DROP
    iptables -A INPUT -i <inside> -m conntrack --ctstate NEW,RELATED,ESTABLISHED-j ACCEPT
    iptables -A OUTPUT -o <inside> -m conntrack --ctstate NEW,RELATED,ESTABLISHED-j ACCEPT
    iptables -A FORWARD -i <inside> -m conntrack --ctstate NEW,RELATED,ESTABLISHED-j ACCEPT
    iptables -A FORWARD -i <outside> -m conntrack --ctstate RELATED,ESTABLISHED-j ACCEPT
    You will need to replace the <inside> and <outside> with your interfaces that are connected to the inside and outside.

    What the above does is allow you to log into the server from the LAN only.
    Traffic will pass from the LAN to the WAN and only established connection will be allowed to pass from the WAN to the LAN

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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