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 12-22-2009, 04:24 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Rep: Reputation: 43
udhcpc problems


Hi all,
I've been trying to connect to an embedded board via a network. Seeing ifconfig said no ip I set about setting this up and setting route etc.
ifconfig eth0 192.168.0.8 net mask ..... up etc.

Still no luck.

I then noticed the terminal was putting an error message
udhcpc[280]: sending discover ...

After a search I found this is a type of protocol for small systems. I them searched the file system and found udhcpc and a file default.sh.
One line showed ifconfig 0.0.0.0 so I changed this is a valid address. There was also some gw stuff set to 0.0.0.0 but I didn't change this. I rebooted and no effect.

Can someone help me with this. Is there a command to stop, set ip, set gateway set route etc. Then reboot. So do I need to do something with default.

I'm a programmer and rarely touch this stuff so please be gentle :s Thanks!

should add I tried

ifconfig eth0 192.168.0.8 netmask 255.255.255.0 up
route add default gw 192.168.0.1

192.168.0.1 is my router

tried ping 192.168.0.8 to self is OK
ping 192.168.0.1 get an error or any other ip

Last edited by knobby67; 12-22-2009 at 06:14 AM.
 
Old 12-22-2009, 07:27 AM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Quote:
Originally Posted by knobby67 View Post

ifconfig eth0 192.168.0.8 netmask 255.255.255.0 up
route add default gw 192.168.0.1

192.168.0.1 is my router

tried ping 192.168.0.8 to self is OK
ping 192.168.0.1 get an error or any other ip
Yes, but before change configuration for eth0 to STATIC, to prevent DHCP client asks for IPs.


Try:
ifconfig eth0 down
ifconfig eth0 192.168.0.8 netmask 255.255.255.0 up
route add default gw 192.168.0.1

Check it after with: "ifconfig eth0" and "route -n"
 
Old 12-22-2009, 08:42 AM   #3
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Original Poster
Rep: Reputation: 43
No luck. ifconfig eth0 shows the correct ip and netmask, but ping 192.168.0.1 won't see the server or anyother pc.

One strange thing
#ping localhost shows 127.0.0.1

also if I use any udhcpc command it changes my IP (without me asking) to 127.0.0.8 , but my udhcpc default.script shows the correct IP I've entered :s. It's as if it's getting the manufacturers host IP, maybe this is set somewhere?
 
Old 12-22-2009, 09:09 AM   #4
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Original Poster
Rep: Reputation: 43
I needed to go into /etc/rc.sysinit and change the route in there.
The usual route command does not appear to override it on this system.


On testing this does not work ifconfig shows it's all OK and I thought I could ping other servers.
However... I've found I cannot ping the embedded board, it shows

From 192.168.0.6 icmp_seq=1 Destination Host Unreachable

Then on further testing on my embedded board I found I can ping any 192.168.0. IP even when no PC with than IP exists.
I think it's some sort of loopback.

Anyway I'm still looking for help please.

Last edited by knobby67; 12-22-2009 at 10:06 AM.
 
Old 12-22-2009, 10:26 AM   #5
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Send output here for "ifconfig eth0" and "route -n"

Thanks
 
Old 12-22-2009, 11:06 AM   #6
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Original Poster
Rep: Reputation: 43
Hi it's

eth0 Link encap:Ethernet HWaddr 0E:00:00:EA:18:F1
inet addr:192.168.0.8 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packages:142 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo link encap:Local loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packages:16 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:1000
RX bytes:1664 (1.6 B) TX bytes:1664 (1.6 B)

route -n

Kernel IP routing table
Destinations Gateway genmask Flags Metric Ref Use IFace
192.168.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 lo


Thanks
 
Old 12-22-2009, 11:22 AM   #7
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Quote:
Originally Posted by knobby67 View Post
Hi it's

route -n

Kernel IP routing table
Destinations Gateway genmask Flags Metric Ref Use IFace
192.168.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 lo


Thanks
Your default route sends any packets different from 192.168.0.1-255 to local host.
Is it what you want?
 
Old 12-22-2009, 12:25 PM   #8
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Original Poster
Rep: Reputation: 43
if I understand what you mean all my PC's are on 192.186.0. 1-8.

My router is on 192.168.0.1. My PC 192.168.0.6, the embedded board which I'm showing is set as above.

If I ping and IP 192.186.0. 0-255 from the embedded board it sends replies (that's why I thought it was working :s). If I ping the router from my pc it's seen, if I ping the embedded board from my pc it gives a time out error.

So I think the embedded board's pings are false, due to the fact I get a reply on any 192.168.0...

What I want is to be able to communicate via the Ethernet with the embedded board. But I can't see or ping it from any PC on the network. But it seems to report it communicate with any ip on the network even ones that don't exist :s

I seems to show its configured OK as afr as I can see but my knowledge is limited.
 
Old 12-22-2009, 01:23 PM   #9
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
add route to local host:
route add -net 127.0.0.0 netmask 255.0.0.0 gw 0.0.0.0 lo


And delete: route del -net 0.0.0.0

Last edited by nimnull22; 12-22-2009 at 01:26 PM.
 
Old 12-22-2009, 03:20 PM   #10
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Original Poster
Rep: Reputation: 43
I'll give it a try in the morning!
 
Old 12-23-2009, 02:58 AM   #11
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Original Poster
Rep: Reputation: 43
Hi no joy :s I just get an error



Can anyonbe help out with this? Sorry All it's driving me mad for Christmas :s

one other thing if I type netstat -r it give the same result as route -n except the 0.0.0.0 for the ip gateway is replaced by a *

Last edited by knobby67; 12-23-2009 at 05:13 AM.
 
  


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
Slackware 11 on a laptop (problems and problems and problems) kizersouzay Slackware 20 02-08-2007 10:52 AM
Marvell Yukon Network driver problems, Lilo Windows boot Problems mellowdog Slackware - Installation 7 01-25-2006 02:18 AM
Problems, problems, problems. Lets start with the soundcard Kre8ive Linux - Newbie 5 08-07-2003 01:20 AM
Problems, problems, problems. Lets start with the ES 1868 AudioDrive Kre8ive Linux - Newbie 1 08-06-2003 07:04 PM

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

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