LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-08-2004, 12:36 PM   #1
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Rep: Reputation: 0
problem to ping on my LAN


hi all!
i m trying to set up a LAN for my LAB using redhat 9.0
all pc have there own ip
name=lab1
one pc has the ip=192.168.1.1
and netmask = 255.255.255.0
OS redhat 9.0

and the other pc is having
name = lab2
ip=192.168.1.2
netmask=255.255.255.0
OS fedora 2.0

but i m not able to ping the machine from lab1 to lab2 or viceversa

what addition setting are required.....
i m new to linux world....so pl explain in detail

tia
 
Old 08-08-2004, 01:40 PM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
check firewall and make sure about cables.

u can stop firewall with
#/etc/init.d/iptables stop
command
 
Old 08-08-2004, 01:46 PM   #3
sibtay
Member
 
Registered: Aug 2004
Location: U.S
Distribution: Ubuntu
Posts: 145

Rep: Reputation: 15
first thing to do is to check your LAN cable.

Secondly, did you restart the network services after assigning IPs?

well if you did'nt then you can restart them with the command

service network restart

Thirdly once i was also having a similar problem with fedora core 2.

Then i typed this command to put my fedora on the network

modprobe e100
 
Old 08-08-2004, 02:27 PM   #4
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
Question 1 Are you pinging by IP address or by the name?

If you can ping by IP address, but not name, then it is a simple means of making entries into the /etc/hosts file

127.0.0.1 localhost.localdomain localhost
192.168.1.1 lab1
192.168.1.2 lab2

However, if you can not ping by IP address either, then you have a network issue. Can I assume these machines are connected via a hub or switch?

Type ifconfig and confirm the IP addresses are set there.

It never hurts to restart the network daemon
/etc/init.d/network restart

I think u said these were Red Hat boxes, so service network restart will work also.

Type route and make sure you see
192.168.1.0 listed in there
 
Old 08-09-2004, 01:34 AM   #5
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
thanks for all these replies.....i had tried all these...but it is still the same
my one PC lab1 has to NICs eth0 & eth1
the eth0 is connected to my extenal LAN
name=lab1
IP=172.28.39.46
netmask=255.255.0.0
gateway=172.28.1.254

i m making my LAN thru eth1
name=lab1
IP=192.168.1.1
netmask=255.255.255.0
gateway=

with ifconfig command it is showing both NICs
i m able to connect to my extenal LAN thru eth0

but with eth1 i m not able to connect to connect to my own LAN...
both the lights on eth1 card are not blinking......(actually i was thinking to make lab1 PC as router later if my intenal LAN is working properly

i m trying to ping my own LAN with ip numbers......
but it is giving the message "destination host unreachable"
same message from lab2 PC........
pl help me out of this......
tia
 
Old 08-09-2004, 07:45 AM   #6
jaganpjames
LQ Newbie
 
Registered: Aug 2004
Location: Hyderabad
Distribution: RH, fedora
Posts: 19

Rep: Reputation: 0
R u directly connecting both the PC's (lab1 , lab2) ?? or u using a hub in between ??
 
Old 08-09-2004, 12:16 PM   #7
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
i m using hub in between and the cable is not cross-over these are straight-through

thru 'ifconfig' command
my lab1 PC (it has 2 NICs) gives Rx=0 and some values for Tx on eth1 (my LAN side) link
and values for both on eth0 (for external LAN) link

and my lab2 PC gives some value for both Rx & Tx on eth0 link

i heard that it should be some value other then 0 for a proper connection....
 
Old 08-11-2004, 08:44 AM   #8
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
does i have to make some entries in to the lab1 PC so that it can recognize the traffic in my LAB LAN side...because it is able to communicate on external LAN side
 
Old 08-11-2004, 09:42 AM   #9
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
I'm not sure what you are asking, so bear with the long response please.

You have two machines
lan1 192.168.1.1 netmask 255.255.255.0
lan2 192.168.1.2 netmask 255.255.255.0

They are directly connected via a hub.
You can not ping lan1 from lan2 or lan2 to lan1

The lights on the hub are on correct?

Can can ping localhost on each machine?
Can you ping lan1's IP Address from lan1?
Can you ping lan2's IP Address from lan2?

I would suggest you try everything using IP addresses first.
Maybe to narrow down what interface is being used on lan2 to do the pinging.

ping -I 192.168.1.2 192.168.1.1
This way lan2 won't try to ping using the interface on the public net.

If noe of the above are issues, Now you can share your connection out.

Now, suppose lan2 is the box with the second ethernet connection. It is a public address and you can reach the internet via that connection. Correct?

If you want the private addresses to reach the internet, you will need to do some masquerading.

I assume this is what you are striving for. If not, then you can skip everything else.

First, you will need to enable lan2 as a router.

echo "1" > /proc/sys/net/ipv4/ip_forward

Then, you need to do some masuerading

iptables -t nat -A POSTROUTING -d ! 192.168.1.0 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.0 -j ACCEPT
iptables -A FORWARD -d 192.168.1.0 -j ACCEPT
iptables -A FORWARD -s 127.0.0.1 -j ACCEPT

Usually, you would put those lines all in a script.
 
Old 08-13-2004, 07:43 AM   #10
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
thanks!
now i can ping my lab's PCs

but after entering the entries in the iptables as given above
my LAb1 PC which is acting as router is not able to ping to the outside LAN
nor my any of the PCs ( which are on my ownLAB LAN side) can ping the outside LAN .
but if i comment these entries in the iptables and restart the iptables n network, then i can ping the outside LAN from my LAB1 PC(router PC) but not from the other PCs in my LAB LAN......

with the first entry as
-t nat -A postrouting -d ! 192.168.1.0 -j MASQUERADE
iptables does not restart and give the following error
iptables-restore v1.2.7a: line 20 seems to have a -t table option
try iptables-restore -h or iptables-restore --help for more information

but if i comment this entry, iptable can be restarted, with other entris ...but does not ping outside LAN
what other entries/modifications i have to make in the iptables.....

tia
 
Old 08-13-2004, 09:13 AM   #11
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
Woops

The postrouting is all caps!

iptables -t nat -A POSTROUTING etc etc etc
 
Old 08-15-2004, 12:42 AM   #12
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
i have tried 'POSTROUTING' as all caps...even then the message is same....
what to do....
tia
 
Old 08-15-2004, 08:37 AM   #13
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
I think it is just a matter of sytax

iptables -t nat -A POSTROUTING -d !192.168.1.0 -j MASQUERADE

Youn see if it is in place by viewing that tables data

iptable -t nat -L
 
Old 08-16-2004, 02:48 AM   #14
feal
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
i tried that too but still the message is same.....i m still not able to ping my external LAN from my LAB LAN....only the PC which has two NICs can ping the outside LAN not other PCs...

pl. help me to come out of this situation....
tia
 
Old 08-16-2004, 06:48 PM   #15
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
OK, your machines on the internal lan....

They do have the default route set to the machine that has the 2 nics right?

if not, try
route add default gw 192.168.whatever.whatever

I didnt read back, but I think it was 192.168.1.1 or something like that. (The IP of the machine that can reach the internet)
 
  


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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
routing problem: my LAN clients can't ping outside catoflu Linux - Networking 1 11-29-2005 06:03 PM
Any idea why this time I can not ping my LAN pc but can PING for ex. www.yahoo.com vakia Debian 5 09-28-2005 06:42 PM
LAN ping problem Jakerohs Linux - Networking 3 12-29-2003 12:07 PM
LAN problem (no ping) tactor Linux - Networking 18 09-02-2003 03:36 AM

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

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