LinuxQuestions.org
Visit Jeremy's Blog.
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 04-06-2003, 07:37 AM   #1
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Rep: Reputation: 0
Network not working


Hi all

Hope you can help me with this problem. I've been trying to set up a small home LAN with 4 PC's to initally have all client PCs to access the internet via kppp. All PCs have Mandrake 9. So far I have been unable to access the internet via the clients. This is what I've done so far.

On the server and client PCs, I have configured the following:

/etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.0.1 server.conference.table server
192.168.0.2 dave.conference.table dave
192.168.0.3 mike.conference.table mike
192.168.0.4 charlie.conference.table charlie
203.43.67.254 ssc.net.au southernstar

On the server only:

/etc/rc.d/rc.local

added to the end:
echo 1 > /proc/sys/net/ip4/ip_forward
iptables -t nat POSTROUTING -o ppp0 -j MASQUERADE

/etc/sysonfig/networking/ifcfg-eth0 was created

DEVICE=eth0
IPADDR=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
USERCTL=yes

Also created a link of this file to /etc/sysconfig/network-scripts

/etc/resolv.conf (for both server and clients)

search localdomain
nameserver 127.0.0.1
nameserver 203.43.67.254
nameserver 139.130.4.5
search ssc.net.au local

I didn't do anything to the /etc/sysconfig/network file on the server.

There is no firewall at this time (shorewall not installed).

On the clients, I have done the following:

/etc/rc.d5/s99local

added the line:

/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

/etc/sysconfig/networking/ifcfg-eth0 file created (e.g. on the first client):

DEVICE=eth0
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
USERCTL=yes

/etc/sysconfig/network

NETWORKING=yes
FORWARD_IPV4=false
HOSTNAME=dave.conference.table
GATEWAYDEV=eth0
GATEWAY=192.168.0.1

On the server (when I'm connected to my ISP), route -n returns:

Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.1 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 10.0.0.1 0.0.0.0 UG 0 0 0 ppp0

On the client, route -n returns:

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.255 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

Can anyone suggest what I'm doing wrong?

Regards

Ray
 
Old 04-06-2003, 08:02 AM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
looks like you have missed the FORWARD chain (I do not know the defaults for the Mandrake so I can be wrong);
post all the ipchains rules
 
Old 04-06-2003, 08:23 AM   #3
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Original Poster
Rep: Reputation: 0
I thought I'd be using iptables rather than ipchains. Which is why I placed the following arguments in rc.local:

echo 1 > /proc/sys/net/ip4/ip_forward
iptables -t nat POSTROUTING -o ppp0 -j MASQUERADE
 
Old 04-06-2003, 08:48 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I can't see why you would need masquerading on the clients.

Can you ping the clients from the server and vice versa?
 
Old 04-06-2003, 08:58 AM   #5
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Original Poster
Rep: Reputation: 0
Yes I can ping the clients from the server and vice versa.
 
Old 04-06-2003, 09:23 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Check you don't have
FORWARD_IPV4=false
in your servers /etc/sysconfig/network file - I'm not sure what the Mandrake default is.

Ah - just noticed the "echo 1" command should be
echo 1 > /proc/sys/net/ipv4/ip_forward
not
echo 1 > /proc/sys/net/ip4/ip_forward
 
Old 04-06-2003, 01:38 PM   #7
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
Sorry, I made mistake in my post: 'post all the ipchains rules' - I thought about iptables chains.
See if you have proper FORWARD chain or post all the iptables chains.
If I am right you should be able:
-ping linux host from the each client PC
-ping each client PC from the linux host
-ping any external ip from linux host
but does not ping external ip from any PC client.
 
Old 04-06-2003, 06:19 PM   #8
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Original Poster
Rep: Reputation: 0
Ok, I've placed the "v" in the echo 1 > /proc/sys/net/ipv4/ip_forward script.

I also changed the /etc/sysconfig/network file on the server to:

NETWORKING=yes
FORWARD_IPV4=true
HOSTNAME=server.conference.table
DOMAINNAME=localdomain

Also with the network file on the clients, shouldn't I have FORWARD_IPV4=false as true??
 
Old 04-07-2003, 03:43 AM   #9
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Original Poster
Rep: Reputation: 0
Can anyone provide any advice to fix my problem?
 
Old 04-07-2003, 07:01 AM   #10
sunnyvic
LQ Newbie
 
Registered: Feb 2003
Location: Ilorin
Distribution: nil
Posts: 4

Rep: Reputation: 0
it could have been better if you had it this way on you server and set "FORWARD_IPV4=true" on the clients too: so you can have something like this:
/etc/sysconfig/networking
NETWORKING=yes
FORWARD_IPV4=true
HOST NAME=server.conference.table
DOMAIN NAME=localdomain
on your sverver

while your clients should have something that looks like this;
/etc/sysconfig/network
NETWORKING=
 
Old 04-07-2003, 07:17 AM   #11
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Original Poster
Rep: Reputation: 0
Hi sunnyvic - half your reply was missing. Are you able to repeat it?

Thanks
 
Old 04-07-2003, 07:19 AM   #12
jazzman
LQ Newbie
 
Registered: Mar 2003
Location: Melbourne, Australia
Distribution: Mandrake
Posts: 7

Original Poster
Rep: Reputation: 0
Hi all

Thanks for all your help so far.

I found that I had "-A" missing from my iptables script for the s99local file, should have been:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Also, I discovered that iptables hadn't been installed on the server.

I can now access the internet from the client PCs.
 
Old 04-07-2003, 01:39 PM   #13
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Well done - you shouldn't need IP forwarding on the clients as you don't need the m to forward packets so you may want to disable it as a slight security point - not that it matters on a small network though.
 
  


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
Network card not working? Cannot activate network device eth0 lifeonitsown Linux - Networking 1 11-17-2005 06:30 AM
Network not working. zaicheke Solaris / OpenSolaris 12 01-04-2005 05:49 AM
Internet working, network not working... phoenix07 Fedora 1 04-11-2004 02:30 AM
Ethernet Adapter not working or Network not working... phoenix07 Linux - Hardware 2 04-09-2004 06:58 PM
Network Not working, please help jacobperkins973 Linux - Networking 2 10-06-2003 07:08 PM

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

All times are GMT -5. The time now is 04:09 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