Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.


  Search this Thread
Old 05-06-2007, 06:57 AM   #1
Registered: Mar 2006
Posts: 381

Rep: Reputation: 30
quick and easy way to get internet connection sharing

A new la entry has been added:

quick and easy way to get internet connection sharing

This was only tested with Slackware, but should work on almost every other distribution and even for Windows.

Assume this is your setup:
A --> B --> Internet

You want to connect A to the internet, B is already connected.

Run this Code:
if [ -f /proc/sys/net/ipv4/ip_forward ]; then echo "Activating IPv4 packet forwarding." echo 1 > /proc/sys/net/ipv4/ip_forward fi iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

on B as root and this
route add default gw $(ipadresse of B)

on A.

Done. Isn't it great?
Old 12-05-2009, 09:49 PM   #2
Registered: Oct 2005
Posts: 116

Rep: Reputation: 15

Very nice easy and shortcut

why dont you provide the example

by placing the values of A, B and ipaddress

that will be more helpfull to understand


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Connection Sharing Xelopheris Linux - Networking 1 02-28-2005 12:08 PM
Internet Connection Sharing siralek88 Linux - Networking 3 01-07-2005 06:11 PM
internet connection sharing crossconnects Linux - Networking 1 09-24-2004 04:49 PM
Internet Connection Sharing SpeedKing Linux - Networking 10 06-27-2004 09:46 AM
Sharing internet connection KRunch Linux - Software 1 02-22-2004 04:46 AM > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 03:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration