Results 1 to 6 of 6

Thread: [SERVER] Failing at iptables

  1. #1
    Join Date
    Sep 2009
    Beans
    35

    [SERVER] Failing at iptables

    I'm setting up a proxy server with Dansguardian to filter. I'm trying to block any access trying to bypass the proxy (IE not using proxy settings )
    Now I have two problems
    1. I can't get ubuntu to reapply my tables after a reboot. I have it set in /etc/network/interfaces:



    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    # The loopback network interface
    auto lo
    iface lo inet loopback




    # The primary (EXTERNAL) network interface
    auto eth1
    iface eth1 inet dhcp


    # The secondary (INTERNAL) network interface
    auto eth0
    iface eth0 inet static
    pre-up iptables-restore < /etc/dansguardian/iptables.rules
    address 192.168.0.1
    netmask 255.255.255.0
    gateway 192.168.0.1
    network 192.168.0.0
    broadcast 192.168.0.255


    # Network bridge
    iface br0 inet static
    bridge_ports eth1 eth0
    address 192.168.0.1
    netmast 255.255.255.0
    gateway 192.168.0.1
    bridge_stp yes
    bridge_fd 0



    Now here is the weird part, re-running "sudo /etc/init.d/networking restart" will apply my ip routes, but it has to be run manually.

    Second problem,

    My without my tables applied I can access the net, it filters ads and porn. With them enabled I get this error:

    http://i174.photobucket.com/albums/w...ps54b482eb.jpg

    This is the tables I applied:

    sudo iptables -A OUTPUT -m owner --uid-owner root -j ACCEPT
    sudo iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -m owner --uid-owner privoxy -j ACCEPT
    sudo iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -j DROP
    sudo iptables -A OUTPUT -o lo -p tcp --dport 8118 -m owner --uid-owner dansguardian -j ACCEPT
    sudo iptables -A OUTPUT -o lo -p tcp --dport 8118 -m owner --uid-owner nathan -j ACCEPT
    sudo iptables -A OUTPUT -o lo -p tcp --dport 8118 -j DROP

    Any ideas?

  2. #2
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: [SERVER] Failing at iptables

    Your networking is all off. Why are you assigning ip addresses to eth0 (dhcp) and eth1 (static) and then bridging them ?
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  3. #3
    Join Date
    Sep 2009
    Beans
    35

    Re: [SERVER] Failing at iptables

    You are backwords good sir,
    eth0 is static and eth1 is dynamic. Basically eth1 is my POP, it will get it's IP from my modem, while eth0 is on the inside of my network. I'm bridging them so that I may pass traffic from network 192.168.0.0 to my modem.

    I'm guessing you already spot my error?

  4. #4
    Join Date
    Sep 2009
    Beans
    35

    Re: [SERVER] Failing at iptables

    Anyone have any ideas why this isn't working?

  5. #5
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: [SERVER] Failing at iptables

    You don't want bridging. Read this: https://help.ubuntu.com/community/In...nectionSharing
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  6. #6
    Join Date
    Sep 2009
    Beans
    35

    Re: [SERVER] Failing at iptables

    You rock. This fixed it. I'll post the full config tomorrow so that anyone who comes across this will have it.

Bookmarks

Posting Permissions

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