Author Topic: How may I share the internet connection with other machines, please?  (Read 3326 times)

Offline vc

  • Hero Member
  • *****
  • Posts: 519
I have a cellmodem, which functions well as /dev/ppp0.  I need to feed this internet connection out through the existing eth0 port to a switch, in order to provide this connection to my local network which is cabled throughout the house.  The system is running an install of Minime 10, which is updated and in fully-operational order.

I have attempted such previously, by attempting to make use of the "Share the internet connection with other local machines" function in the 'Network & Internet' section of the PCC - however, those attempts have never succeeded.

Could anyone assist me, please?  I do not know what I am doing wrong, and I really need to get this connection established.
« Last Edit: June 01, 2010, 08:50:28 PM by vc »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: How may I share the internet connection with other machines, please?
« Reply #1 on: June 02, 2010, 01:01:19 AM »
You need to give those reading some indication of your hardware, what exactly you have tried to get this working and report in detail what happened for each attempt and what error messages you received.
Without such information the process of trying to help you will become frustrating for everybody as suggestions are made which have already failed for you.

Also have you read other threads on this subject? ...  you did not say, so here are a few for you to read ...

http://www.pclinuxos.com/forum/index.php/topic,68321.0.html

http://www.pclinuxos.com/forum/index.php/topic,58947.0.html

http://www.pclinuxos.com/forum/index.php/topic,59550.0.html

http://www.pclinuxos.com/forum/index.php/topic,60145.0.html

regards.

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How may I share the internet connection with other machines, please?
« Reply #2 on: June 02, 2010, 07:33:49 AM »
Hello, JohnBoy.  I thank you for replying.

The problem does not seem to be equipment-related nor dependent upon OS version.  I have been attempting this since I first obtained the cellmodem, more than two years ago.  I have attempted it in Minime 08, 09, and 10; hardware-wise, I have attempted it upon several Asus 701-model EeePCs, an Acer TravelMate, a Compaq DeskPro ENS, a QDI Pentium-Pro system, and several Asus 440BX and 440ZX Slot-1 motherboards with various processors ranging from P2-350 to a Tualatin Cel-1300 in a 'slotket' adapter, using both straight and cross-wired and even ThinLAN coaxial cables (all of which were tested and known to be functional).  I have tried RealTek cards, and Intel cards, and DEC 'Tulip' cards, and 3Com cards, and others (again, tested and known to function properly).  Not once has ICS ever succeeded on any of these.  In every instance, the result has been exactly the same as the fourth link you provided:

http://www.pclinuxos.com/forum/index.php/topic,60145.0.html

The present test setup consists of two EeePCs:  a 701SD running the current Minime 10 and utilising the cellmodem for the internet connection that I am posting this message on now, an original 701 running Minime 08, and a cross-wired cable connecting their respective eth0 ports together.

Is the ICS function in PCC broken?  Or am I doing it wrong, somehow?  What level of expertise is required?
« Last Edit: June 02, 2010, 07:43:46 AM by vc »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: How may I share the internet connection with other machines, please?
« Reply #3 on: June 02, 2010, 08:31:02 AM »
Where is AndrzejL when he is needed?    ......  Hellooooooooooo  Andyyyyyyy ......

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4037
Re: How may I share the internet connection with other machines, please?
« Reply #4 on: June 02, 2010, 10:28:47 AM »
These are the commands I use:
Code: [Select]
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
/sbin/iptables -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT

I have them in a script I use when I want to set up NAT with virtual machines which use bridged networking on the Ethernet port.

The corresponding commands to turn it off are:
Code: [Select]
iptables -t nat -D POSTROUTING -o ppp0 -j MASQUERADE
/sbin/iptables -D FORWARD -i eth0 -o ppp0 -j ACCEPT
/sbin/iptables -D FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
echo 0 > /proc/sys/net/ipv4/ip_forward
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline surfinusa555

  • Jr. Member
  • **
  • Posts: 24
Re: How may I share the internet connection with other machines, please?
« Reply #5 on: June 02, 2010, 01:13:58 PM »
Edit /etc/shorewall/interfaces as root make sure it looks like this.  The one with 'net' should be the one getting the internet connection.  The one with 'loc' is the one sharing it.  As long as you told me your setup correctly, adding those last two lines should do it.
Quote
#
# Shorewall version 4 - Interfaces File
#
# For information about entries in this file, type "man shorewall-interfaces"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
###############################################################################
#ZONE   INTERFACE       BROADCAST       OPTIONS
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
net ppp0 detect
loc eth0 detect


After you are certain it is saved go back into
PCLinuxOS Control Center -> Network & Internet -> Share the Interenet Connection with other local machines

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How may I share the internet connection with other machines, please?
« Reply #6 on: June 02, 2010, 06:06:56 PM »
I am sorry; however, neither method seems to be successful.  I first attempted the instructions offered by kjpetrie; they were unsuccessful, unfortunately.  I then attempted to implement the instructions offered by surfinusa555, which did produce partial results - the ICS function in PCC was then able to 'see' eth0 properly, and proceed onward.  It then installed in turn:  bind, dhcp-server, and squid; upon completion, I could see eth0 being activated as the 'client'-side EeePC was booted up... but again, no real connection.  An attempt to ping 192.168.1.1 from the 'client' machine indicated:

connect:  Network is unreachable

It seems to me by this point that the entire notion may be infeasible?  I noted the posting dates in the fourth link that JohnBoy had kindly provided, and it is obvious by that particular thread that this issue has been unresolved for quite some time.  I am therefore left to conclude that it must be unresolved for a reason.

I do wish to thank everyone for their respective assistances, regardless.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: How may I share the internet connection with other machines, please?
« Reply #7 on: June 02, 2010, 07:20:25 PM »
There is a how-to in the wiki for ICS...  The link to the wiki is in my signature.

IIRC the trick is setting up the firewall properly before running the ICS wizard.



EDIT:

Here is a direct link:
http://www.pclinuxos.com/wiki/index.php/Internet_Connection_Sharing
« Last Edit: June 02, 2010, 07:23:19 PM by travisn000 »

Offline surfinusa555

  • Jr. Member
  • **
  • Posts: 24
Re: How may I share the internet connection with other machines, please?
« Reply #8 on: June 02, 2010, 09:40:33 PM »
It's not impossible to do.  I currently use it with my xbox.  I had to reboot my computer after setting it up.  Did you try that?  Also, I didn't install dhcp or squid proxy (overkill for home).  I used a static ip and google dns with my xbox.