Results 1 to 6 of 6

Thread: IP tables Permission Denied! Atempting to share internet conection.

  1. #1
    Join Date
    Dec 2007
    Location
    Portland, Or.
    Beans
    33
    Distro
    Ubuntu 10.04 Lucid Lynx

    Angry IP tables Permission Denied! Atempting to share internet conection.

    Howdy. I am working on trying to allow one computer to go through my other nic (eth1) and out into the internet with via my WIFI (eth2).

    So I have finally got a handle on how to do this.

    I set the client and eth1 (on the internet connected box) to static IP addresses so as to avoid working with DHCP.

    Then I started playing with my IP tables. I don't really know what most of it means I am Copy Pasting from a walk through.

    I got this far:
    Code:
    xess@xess-desktop:~$ sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
    xess@xess-desktop:~$ echo 1 > /proc/sys/net/ipv4/ip_forward
    bash: /proc/sys/net/ipv4/ip_forward: Permission denied
    xess@xess-desktop:~$ sudo echo 1 > /proc/sys/net/ipv4/ip_forward
    bash: /proc/sys/net/ipv4/ip_forward: Permission denied
    xess@xess-desktop:~$ iptables-save > /etc/iptables.rules
    bash: /etc/iptables.rules: Permission denied
    xess@xess-desktop:~$ sudo iptables-save > /etc/iptables.rules
    bash: /etc/iptables.rules: Permission denied
    I know I made it so far... Any way my question is why do I not have permission? How do I fix this?

    In spite of all this I still have no desire for Windows...
    Last edited by rick3878894; August 24th, 2008 at 11:32 AM.

  2. #2
    Join Date
    Apr 2007
    Location
    Germany
    Beans
    952
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: IP tables Permission Denied! Atempting to share internet conection.

    you need to execute those commands as root. If you run something like the echo commands (which are obsolete and should not be used anymore) then you need to do so as root. Since you are also using bash output redirection this is better done in a proper root console than via sudo... here are some examples


    sudo su
    iptables -P FORWARD ACCEPT
    iptables -A POSTROUTING --table nat -o eth1 -j MASQUERADE
    sysctl -w net.ipv4.ip_forward=1
    that should do what you are trying to do. ALso, pleae notice the first line in the quote - it makes you root. So these commands will also work in root consoles (as they are missing the sudo infront on purpose).

    hope it helps
    Calvin: I'm being educated against my will! My rights are being trampled!
    Hobbes: Is it a right to remain ignorant?
    Calvin: I don't know, but I refuse to find out!

  3. #3
    Join Date
    Dec 2007
    Location
    Portland, Or.
    Beans
    33
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: IP tables Permission Denied! Atempting to share internet conection.

    Well I can write now and get it save but I can only see as far as the wifi card when pinging from work station. I still can't connect to the router or the internet for that matter.

  4. #4
    Join Date
    Apr 2007
    Location
    Germany
    Beans
    952
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: IP tables Permission Denied! Atempting to share internet conection.

    mhm... has your client the right default gateway as well as a correct dns ?
    Also, i suspect on the machine in question the internet is working ?
    Can you post the ip configuration of your server/router as well as your clients for further debugging ?

    thanks
    Calvin: I'm being educated against my will! My rights are being trampled!
    Hobbes: Is it a right to remain ignorant?
    Calvin: I don't know, but I refuse to find out!

  5. #5
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: IP tables Permission Denied! Atempting to share internet conection.

    Late, as usual...
    Have you seen this?
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  6. #6
    Join Date
    Dec 2007
    Location
    Portland, Or.
    Beans
    33
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: IP tables Permission Denied! Atempting to share internet conection.

    Thanks folks. I just built a router for it that plugs into a switch. Simple and effective

Tags for this Thread

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
  •