Linux newbie - trying to get machines to ping each other

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Linux newbie - trying to get machines to ping each other

Post by poizn »

Hello

Please can someone help me!!!

I am a Linux newbie, just recently installed Suse 10 (yeah!!! - dig the green cameleon)
After a bit of fiddeling around i found the YaST2 server config center app and found the network card settings and assigned an ip (192.168.0.2) and thought everything was cool :) so i tried pinging my windows box (192.168.0.9) but it didnt work. I fiddled around and they eventually pinged each other once (dont know exactly what i did). So i though everything was kewl so i tried surfing my web server (got a web server on my windows box) but it didnt work. Then i tried pinging again and nothing.

Im pretty sure all hardware is working because I previously had windows and Mandrake 8 on the linux box and pinging / surfing was working fine (in windows and linux)

So does anyone know if there are any config's that im missing or anything else i can try???

Please help linux newbie!!!! help is much appreciated

thansk in advance!!!! :)

(please dont let me slip back into the clutches of evil EVIL windows!!! :twisted: )
jamiel
Forum Contributor
Posts: 276
Joined: Wed Feb 22, 2006 5:17 am
Location: London, United Kingdom

Post by jamiel »

Did you set your netmask and gateway?
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Post by poizn »

Hope i dont sound stupid here but what is a netmaks? Similar to submask? And where do i set that?

And dont I only have to set a gateway if im going on the net?
I dont have the net at home :( (sux!!! but want to get it soon just have to apply and wait the million weeks it takes for the only landline operator in our country to come and install!!!) so this is all over lan
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

poizn wrote:Hope i dont sound stupid here but what is a netmaks? Similar to submask? And where do i set that?

And dont I only have to set a gateway if im going on the net?
I dont have the net at home :( (sux!!! but want to get it soon just have to apply and wait the million weeks it takes for the only landline operator in our country to come and install!!!) so this is all over lan
What do the following three commands give you? Copy and paste it please.

Code: Select all

ifconfig
route -n
cat /etc/resolv.conf
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Post by poizn »

Thanks for the reply

Ill have to try the commands at home (havent yet installed Linux at work :( if only they would give me a second machine here so i could fiddle around with Linux - sux!!!!)

Thanks for the help will reply tomorrow :)
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Post by poizn »

Hey d11wtq I tried the commands you gave me yesterday and heres the outcome

Code: Select all

SERVER:~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:80:AD:00:26:3B
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::280:adff:fe00:263b/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:325 dropped:0 overruns:0 frame:0
          TX packets:44 errors:2 dropped:0 overruns:0 carrier:2
          collisions:0 txqueuelen:1000
          RX bytes:1499 (1.4 Kb)  TX bytes:4620 (4.5 Kb)
          Interrupt:10 Base address:0xdc00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:75 errors:0 dropped:0 overruns:0 frame:0
          TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4918 (4.8 Kb)  TX bytes:4918 (4.8 Kb)

Code: Select all

SERVER:~ # route -n
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
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

Code: Select all

SERVER:~ # cat /ect/resolv.conf
cat: /ect/resolv.conf: No such file or directory

Thanks for the help :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

cat /ect/resolv.conf isn't what I wrote ;) It's "etc".

Your routing looks wrong. Are you behind a router? If so, type:

Code: Select all

route add default gw 192.168.0 <last_octant_of_your_router_ip_here>
Mine, for example would be:

Code: Select all

route add default gw 192.168.1.254
Since my router IP address is 192.168.1.254. Without a gateway to the net you won't be able to access anything beyond your own machine.

EDIT | Sorry but I should ask the *really* obvious question... do you have DHCP on the router?? If you then you should be able to type:

dhcpcd eth0

or

dhclient eth0

That should give you an IP, set your gateway and put the correct details in /etc/resolv.conf
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Post by poizn »

dam what a day, sorry its taken so long to reply but our power went out :( and then it blew our main input power point (WOW THAT SUCKS!!!!)
ifconfig
route -n
cat /etc/resolv.conf
Sorry if i mis understood the last command but thats what you got there

is the command that i should try

Code: Select all

etc/resolv.conf
just like that?

About the router, i dont have one. Just got my 2 machines. No router's, firewalls / awesome devices and obviously no DHCP on router (but you figured that out by now dugh to me ;) hehehe). Just trying to get the networking pc to pc working first ;)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Ah well in that case the /etc/resolv.conf is pointless but just for the record I meant:

"cat /etc/resolv.conf"

`cat' is a linux command for dumping the contents of a file to the screen, so I basically was asking to see the file contents ;)

Next question... when you say it doesn't work when you try to ping the machine are you just getting no ping packets returned or are you getting an error to the effect of "Network Unreachable" ?
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Post by poizn »

Hey cool learn something new every day thanks for the command help (cat)

Yip i'm getting an error something to the effect of "network unreachable"

On the windows machine "Destination Host Unreachable"
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

It comes down to the fact that your machines don't know how to reach other... As already hinted, the program route allows you to manipulate the 'routing information = (map with info how to reach other machines)' your machines have...

In essense, 'man route' will give you an extended explanation of what can be done... Eg: if you want to tell machine A that it can reach machine B (with ip 192.168.0.2) via network interface eth0 you would add a route as following on that machine:

route add -host 192.168.0.2 dev eth0

On machine B, you might want to tell that machine A (with ip 192.168.1.0) can be reached via it's interface eth0 you'd add a route on that machine:
route add -host 192.168.0.1 dev eth0

But make sure to read a networking tutorial or howto.. (http://www.tldp.org is a good start for research...)
User avatar
poizn
Forum Newbie
Posts: 17
Joined: Thu Jun 15, 2006 10:12 am
Location: Durban - Souht Africa

Post by poizn »

Awesome shot for the tutorial and commands ;)

Will read it later and try it at home ;)
Post Reply