LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2002, 03:47 PM   #1
keithturner
LQ Newbie
 
Registered: Dec 2002
Posts: 13

Rep: Reputation: 0
ethernet question


Hi,

I have a fairly frustrating problem. I'm trying to switch a machine which has dhcp working on it to using a static address. I have cables, tested and working, to both, using a router to connect to the internet. The dhcp works fine, but I can't get the static to work at all.

I'm trying to do this on a Sun Linux OS, release 5.0.

I edited the ifconfig-eth0 and the network file as has been suggested here and in other places, but the route command shows a * for the gateway, which I suspect is part of the problem. There doesn't seem to be any configuration tools included in this version.

(in the eth0 I made Bootproto=static, and reset the IPADDR and netmask to my local values - in network I placed the router address in the GATEWAY=) - what's really frustrating is that I plugged the cable into my 2000 machine and used the same setting for the tcp/ip connection with success.

I can make dhcp work by switching back to the old original files, but no luck with the static files.

I would appreciate a list of what to check. This machine comes from another company and may have weird other stuff installed that is overriding these settings. I'd prefer not to have to reinstall the OS if possible.

Suggestions gratefully appreciated

Keith Turner
kturnerSPAMFILTER@cloudsystems.com
 
Old 12-13-2002, 10:42 PM   #2
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
I don't think that the * is necessarily a problem. An asterisk (*) simply means that the packets go directly to the host. To get this result, you opened a terminal and typed
route
which should have returned something like
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.1.1.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default generic 0.0.0.0 UG 0 0 0 eth0

if you instead type
route -n
you should get a display more like you were expecting

# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.1.1.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.1.1.1 0.0.0.0 UG 0 0 0 eth0

If you do have a problem, you can try adding a default gateway with
/sbin/route add default gw 10.1.1.1 (substituting the correct IP address for 10.1.1.1
to check the status of your connection, type
mii-tools (if you get an OK at the end of the display, then you are all set)
and then if you still have problems post the results of your latest
route -n

Last edited by rioguia; 12-13-2002 at 10:46 PM.
 
Old 12-13-2002, 10:50 PM   #3
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Rep: Reputation: 30
I'm not sure if it's available on the Sun OS, but with RedHat I switched from using dhcp to using a static IP address by running "netconfig" and filling out the fields.
 
Old 12-18-2002, 03:01 PM   #4
keithturner
LQ Newbie
 
Registered: Dec 2002
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for the help.

I'm still struggling. I have it set so that I can start Mozilla and see the web.

However I cannot ping to it from another computer (using the numeric address), I get a request times out message. I can ping other machines behind our firewall with no problem.

When I try to ping our web server from the linux machine I get a "Destination Host Unreachable" and a message saying that the connection was refused from the webserver when I try to access through Mozilla. I have no problems seeing the same page through my Windows machine, both internally and remotely over the web.

I can run linuxconf, but when I look at the adapters they always seem to revert to 192,168.1.161 though if I do an ifconfig -a I see the devises set to the correct IP address.

I want to set the machine up as a test webserver, and it seems that the first step is having it seen by the world. I'm pretty new to this stuff, and no suggestion is too idiotic, so any help is gratefully appreciated.

Thanks,

Keith
 
Old 12-18-2002, 03:10 PM   #5
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
check etc/sysconfig/network-scripts/ifcfg-eth0

etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=xxx.xxx.0.255 (supply correct IP address)
IPADDR=xxx.xxx.0.1 (supply correct IP address)
NETMASK=255.255.255.0
NETWORK=xxx.xxx.0.0 (supply correct IP address)
ONBOOT=yes
 
Old 12-18-2002, 04:28 PM   #6
keithturner
LQ Newbie
 
Registered: Dec 2002
Posts: 13

Original Poster
Rep: Reputation: 0
This is pretty much waht I'm using.

I have a couple of questions.

It seems that my route table is all screwed up. When i try to use the "route del" command to remove routes i get an unknown host error.

I am unsure what the broadcast setting should be, should it be identical to the IP address?

Keith
 
Old 12-18-2002, 05:15 PM   #7
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
you probably should just post your routing table here and let folks critique it.
route -n
 
Old 12-18-2002, 05:57 PM   #8
keithturner
LQ Newbie
 
Registered: Dec 2002
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks

I've really messed it up trying to fix it. I've replaced the IPs of some of the addresses with explanative text enclosed in < > braces and added line numbers as this is a very tight little reply box.

I have 2 ethernet cards, only one has a cable:

Line Destination Gateway Genmask Flags Metric Ref Use Iface
1 <IP I want to see> <My Router> 255.255.255.255 UGH 0 0 0 eth0
2 <IP from when I 0.0.0.0 255.255.255.240 U 0 0 0 eth1
Was on DHCP> <As is on the MS on
the network>
3 <first 3 number sets>.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
4 <first 3 number sets>.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
5 127.0.0.1 0.0.0.0 255.0.0.0 U 0 0 0 lo
6 0.0.0.0 <My Router> 0.0.0.0 UG 0 0 0 eth0

If i do a ifconfig -a I see
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr <correct - what I want to use> Bcast:<Same as inet addr> Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric 1
RX packets:1960 errors:0 dropped:0 overruns:0 frame:0
TX packets:3274 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:653125 (637.8 Kb) TX bytes:337221 (329.3 Kb)

eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr <correct - what I want to use> Bcast:<Same as inet addr> Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric 1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:4 carrier:0
collisions:0
RX bytes:0 (0.0 Kb) TX bytes:168 (168.0 b)

eth1:0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr <correct - what I want to use> Bcast:<first 3 number sets>.<What I want to use +3> Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric 1

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:175 errors:0 dropped:0 overruns:0 frame:0
TX packets:175 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:12461 (12.1 Kb) TX bytes:12461 (12.1 Kb)


Thanks again for your responses.

Regards, Keith
 
Old 12-19-2002, 02:19 PM   #9
keithturner
LQ Newbie
 
Registered: Dec 2002
Posts: 13

Original Poster
Rep: Reputation: 0
I solve the problem by editing the static-route table - it was pointing to the wrong destination.

Thanks again for your help rioguia.
 
Old 12-19-2002, 03:55 PM   #10
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
CONGRATS

I struggled until Peter Robb helped me the first time I got my tables to work. I'm glad to help someone else. I'm reworking my firewall so I'm betting you'll see a post from me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ethernet cache question cranium2004 Linux - Networking 0 01-31-2005 05:56 AM
Ethernet Question duddy11 Linux - Newbie 1 08-01-2003 11:23 PM
please help - ifconfig/ethernet question JamesM Linux - Networking 3 07-25-2003 09:10 AM
Another ethernet question EyeGuy Linux - Newbie 5 12-29-2001 05:24 PM
easy ethernet question trapper Linux - General 3 10-22-2001 02:27 AM


All times are GMT -5. The time now is 01:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration