LinuxQuestions.org
Review your favorite Linux distribution.
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 08-16-2003, 03:13 PM   #1
Kelv1979
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Rep: Reputation: 0
How do I set up an Internet Gateway???


Hello there!

I am a complete to Linux having decided this week to have a go at setting up a RedHat Linux 9 server to share files and my internet connection with 2 PCs in my house.

The internet connection on the Linux server is working fine (I'm using it right now) and I've got the network set up and both machines can ping each other so at least I've done something right!

The problem is that I'm working through a book to set this all up and its Internet Gateway tutorial doesn't seem to work and, to me, seems extremely brief.

All it tells me to do is change the sysctl.conf file from reading

net.ipv4.ip_forward = 0

to

net.ipv4.ip_forward = 1

and then configure the clients to use the server as their gateway. Is this right?

If so I must have something else set wrong as I'm getting nothing on the client machine (Windows XP). Does anybody have any suggestions for either what's missing or what I'm doing wrong? I thought I might have to route the traffic from one card to the other but I have no idea how.

Thanks in advance for any help

Kelv1979
 
Old 08-16-2003, 03:19 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Yes that is correct but you will also need some iptables forwarding rules. Take a look at:
http://www.linuxquestions.org/questi...threadid=72649

There are lots more tips on this site. Just search for iptables.

Don't hesitate to ask if you have problems.
 
Old 08-16-2003, 04:46 PM   #3
robthebob
Member
 
Registered: Aug 2003
Location: York, UK
Distribution: Gentoo, WinXP
Posts: 40

Rep: Reputation: 15
I'm having similar problems. I've got my cable modem attached to a laptop running win2k with internet connection sharing. This works ok under windows, but I can't seem to get the other machines to access the internet through it under linux. The LAN works fine between my computers between windows and linux.

Unfortunately I can't really switch the laptop to linux, as other users wouldn't be able to take the downtime. Is this a lost cause, or do I require some 3rd party software to replace microsoft ICS?

Ask away for printouts of anything relevant in my /etc dir

Thanks

Last edited by robthebob; 08-16-2003 at 04:47 PM.
 
Old 08-17-2003, 06:51 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Both of you try taking a look at this tutorial:
http://www.yolinux.com/TUTORIALS/Lin...rkGateway.html
 
Old 08-19-2003, 04:27 PM   #5
Kelv1979
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the suggestions!

I think I must be being a complete div as when I worked through both tutorials (using only the IPTABLES stuff from the second which I assumed was the right thing to do) I found that after starting the IPTABLES service again I couldn't even access the internet from the Linux machine! I then tried the commands

iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

which seemed to open it up for the Linux machine to get out to the world but at this point I can't ping the Linux machine from anywhere else on the network. Incase it's any help to anyone this is the result I get from iptables -L :

Chain INPUT (policy DROP)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

Chain FORWARD (policy DROP)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
all -- anywhere anywhere
all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED


I'm beginning to get the inclination to give up on a Linux server all together - maybe I'm just not cut out for Linux!

Kelv
 
Old 08-19-2003, 04:49 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
That is becasue your policy is set to drop all connections by default.
 
Old 08-20-2003, 02:47 PM   #7
robthebob
Member
 
Registered: Aug 2003
Location: York, UK
Distribution: Gentoo, WinXP
Posts: 40

Rep: Reputation: 15
Thanks for the pointer to that tutorial. I hadn't made the connection between nameserver and DNS (feel free to laugh) so I hadn't added my ISP DNS servers to the resolv.conf

All working now thanks.
 
Old 08-21-2003, 03:00 AM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Cool - well done
 
  


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
default gateway not set by PPPoE, can't ping internet rproffit Linux - Networking 3 12-17-2007 05:29 AM
How can I set up an internet gateway? peaceofcrap2001 Linux - Networking 1 06-11-2005 10:39 PM
pls help to set up debian as internet gateway cutejai Linux - Networking 3 04-25-2005 10:51 AM
How do i set ppp0 as default gateway for internet sharing in Redhat? Julian_Thong Linux - Networking 11 08-18-2004 06:54 PM
How do I set up RH 9 to see internet via Mandrake Gateway? steve1401 Linux - Networking 1 08-26-2003 01:31 PM

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

All times are GMT -5. The time now is 03:00 AM.

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