How to share the internet connection to my lan

Asked by Jon Charge

I have a DSL modem, and two ethernet cards in my computer. The DSL modom leases my computer an IP. Is there a very simple way that I can plug the laptop into the *other* Ethernet card, and use the Internet that way? I tried to follow instructions based on other web pages, but I don't think I did so correctly.

Thank you for you help.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1
Revision history for this message
Jon Charge (seropith) said :
#2

That is the page I followed. For example

sudo echo 1 > /proc/sys/net/ipv4/ip_forward

gave me permission denied.

I use Juanty.

Is there a graphical tool that will set up connection sharing seamlessly?

Thank you for your help.

Revision history for this message
Kevin Hunter (hunteke) said :
#3

> Is there a graphical tool that will set up connection sharing seamlessly?

Yes and no. There is no canonical one for this at the moment (at least that I'm aware of). You may get lucky with one tool or another. I absolutely that that this is an annoying problem, but one that apparently only *usually* comes up in corporate settings where expertise on-hand is plentiful. In the meantime, us mere mortals need help.

The instructions on that page will work. As regards your specific problem in following that page, it's a subtle difference in how the instructions are written: '$' vs '#'

In any instructions involving the Unix shell, when you see '$' at the beginning of the line, it means "execute this as a normal user". When you see '#' at the beginning, it means "Be the root (all-powerful) user to run this command."

So, what's happening with this command?
$ sudo echo 1 > /proc/sys/net/ipv4/ip_forward

You are properly running the 'echo' command as the root user, but that '>' character means "write to this file." Unfortunately, the sudo only applies to echo, not to the '>' and farther. So, root writes '1', but your user reads that one and tries to write it a protected area. You user has right to do that. Ways to fix this:

  -- become the root user for the entire command:
$ sudo su -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

  -- become the root user until logout
$ sudo su -
  [ ... you become root user, and the prompt changes to '#' ... ]
# echo 1 > /proc/sys/net/ipv4/ip_forward
# logout
$

(If the prompt is empty, you can hit Ctrl+D instead of typing logout.)

Revision history for this message
Kevin Hunter (hunteke) said :
#4

Gah, go me and proofreading what I wrote:

>I absolutely that that this is an annoying problem ...
I absolutely agree that this is an annoying problem ...

> You user has right to do that. Ways to fix this:
Your user has no rights to do that. Ways to fix this:

Can you help with this problem?

Provide an answer of your own, or ask Jon Charge for more information if necessary.

To post a message you must log in.