LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2004, 03:52 PM   #1
cbunney
LQ Newbie
 
Registered: Sep 2004
Location: Fowey, UK
Distribution: Mandrake 10.0
Posts: 5

Rep: Reputation: 0
Unhappy cannot connect to internet via gateway


Hi,

I am a fairly new Linux user and very new to networking!

I have set up a small (2 computer) private network. I have one machine running Mandrake Linux 10.0 (kernel 2.6.3-7) which is connected to the internet via a modem using PPP and is also connected via ethernet to my private local network.

My second machine is running TINY Linux (kernel 2.2.6) and is connected to the private network only.

I have managed to set up both so that they can talk to each other (ping, NFS, ftp etc) and wanted to set up the machine connected to the internet as a gateway. I have gone through all the steps I can find in various howto's etc but I just cannot access the internet from my private network.

I have set up a gateway machine using 'route add' and if I ping an external site such as 'yahoo' it manages (after a small delay) to resolve the name to an IP address, but it cannot access it.

What am I doing wrong? Do I need to set up some sort of packet routing on my gateway. Here is the output of 'route -n' from the gateway:

--------------------------
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
195.92.66.197 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 195.92.66.197 0.0.0.0 UG 0 0 0 ppp0
--------------------------

And from the machine on my private network:
--------------------------
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
--------------------------

One thing that I have done is stopped shorewall - my firewall program - as it was blocking my connections to and from the two machines - would this cause a problem?

Any help would be appreciated.

Regards.
 
Old 09-12-2004, 04:09 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
If the computer in your private network is using an RFC1918 private IP address (ie 192.168.x.x) then you need to set up IP Masquerading on your gateway machine.

The howto is a bit out of date but should help you out:
http://www.ecst.csuchico.edu/~dranch...tml/index.html

There is no info on 2.6.x kernels but the info for 2.4.x kernels should still be relevant as far as kernel modules you will need.

Here is another link for IP Masq info:
http://www.e-infomax.com/ipmasq/
 
Old 09-13-2004, 06:33 AM   #3
cbunney
LQ Newbie
 
Registered: Sep 2004
Location: Fowey, UK
Distribution: Mandrake 10.0
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks bulliver,

I have managed to get my gateway to work using the links you gave me....I am not entirely sure HOW it is working (as I just copied the rc.firewall script)....but it works nethertheless....!!!

Cheers for your help.
 
Old 09-13-2004, 03:13 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
.I am not entirely sure HOW it is working (as I just copied the rc.firewall script).
Well that was easy huh!

My guess is that if you are using a stock kernel, then all the modules you needed were built and waiting to be loaded. The firewall script itself has code that loads the modules, so you were off to the races.

Just remember that if you build a custom kernel you should follow the advice in the howto to make sure the needed modules get built.
 
  


Reply



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
Gateway disappears, can't connect to internet eli_pack Linux - Wireless Networking 5 01-25-2017 06:27 AM
FC4 can't connect the gateway zhangweiwei Linux - Networking 1 07-31-2005 05:05 PM
intermittent failure winPC connect internet thru ipmasq linux gateway takahaya Linux - Networking 0 05-13-2005 06:35 PM
How to connect to a gateway on a different subnet? anGeR Linux - Networking 1 04-09-2004 08:50 AM
LAN machines unable to connect to Internet through (firewall on )gateway nishi_k_79 Linux - Security 1 11-13-2003 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:54 PM.

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