LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ethernet question (https://www.linuxquestions.org/questions/linux-newbie-8/ethernet-question-38267/)

keithturner 12-13-2002 03:47 PM

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

rioguia 12-13-2002 10:42 PM

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

pilot1 12-13-2002 10:50 PM

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.

keithturner 12-18-2002 03:01 PM

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

rioguia 12-18-2002 03:10 PM

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

keithturner 12-18-2002 04:28 PM

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

rioguia 12-18-2002 05:15 PM

you probably should just post your routing table here and let folks critique it.
route -n

keithturner 12-18-2002 05:57 PM

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

keithturner 12-19-2002 02:19 PM

I solve the problem by editing the static-route table - it was pointing to the wrong destination.

Thanks again for your help rioguia.

rioguia 12-19-2002 03:55 PM

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.


All times are GMT -5. The time now is 06:27 PM.