LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Substituting a machine in the LAN caused it to lose the connection. (http://www.linuxquestions.org/questions/slackware-14/substituting-a-machine-in-the-lan-caused-it-to-lose-the-connection-4175450537/)

stf92 02-17-2013 09:37 AM

Substituting a machine in the LAN caused it to lose the connection.
 
Hi:

I removed the machine from the LAN, took its hard drive and installed it in a new machine, I plugged this new machine into the LAN, and now ifconfig only reports the lo section. Could somebody tell me how to get back the conection?

onebuck 02-17-2013 10:03 AM

Member Response
 
Hi,

Try 'ifconfig -a' to show all devices, even the ones that are down. If you still do not see the device then I would look at 'dmesg', 'lspci -vv' & 'lsmod' to start troubleshooting.

stf92 02-17-2013 10:17 AM

Quote:

Originally Posted by onebuck (Post 4893667)
Hi,

Try 'ifconfig -a' to show all devices, even the ones that are down. If you still do not see the device then I would look at 'dmesg', 'lspci -vv' & 'lsmod' to start troubleshooting.

I did 'ifconfig -a' and it showed eth1, although, as I have only one NIC in the machine, I think it should be eth0. But now I realize it has nothing to do with the LAN. This machine connected directly to the modem does not seem to be able to connect to the internet, don't know why. Perhaps some BIOS setup tuning is needed.

onebuck 02-17-2013 10:46 AM

Member Response
 
Hi,
Quote:

Originally Posted by stf92 (Post 4893673)
I did 'ifconfig -a' and it showed eth1, although, as I have only one NIC in the machine, I think it should be eth0. But now I realize it has nothing to do with the LAN. This machine connected directly to the modem does not seem to be able to connect to the internet, don't know why. Perhaps some BIOS setup tuning is needed.

Being new or different hardware I would still look at the 'dmesg' and 'lspci -vv' to see what & how things are identified by the kernel.
Check the module(s) for the NIC. Some drivers will identify and get assignment eth1 to the device. Early Broadcom and some old 3com NIC comes to mind.

BTW, Which distribution?

TobiSGD 02-17-2013 10:52 AM

Quote:

Originally Posted by stf92 (Post 4893673)
I did 'ifconfig -a' and it showed eth1, although, as I have only one NIC in the machine, I think it should be eth0.

Udev, the software that is in charge of connecting the device names to the physical hardware (simplified) stores the data of some devices it knows in /etc/udev/rules.d, in this case it will be the file 70-persistent-net.rules. The data stored in that file is for the old network device, but udev sees only the new device, giving it therefore the name eth1 instead of eth0. Delete that file and reboot the machine, the network device will come up as eth0, as it should be.

stf92 02-17-2013 10:53 AM

It's the same machine and slack distro that made X fail: slackware 12.0. I had already done 'dmesg|grep -i eth' and it seemed the NIC was correctly identified as Realtek 8139.

stf92 02-17-2013 10:57 AM

Quote:

Originally Posted by TobiSGD (Post 4893701)
Udev, the software that is in charge of connecting the device names to the physical hardware (simplified) stores the data of some devices it knows in /etc/udev/rules.d, in this case it will be the file 70-persistent-net.rules. The data stored in that file is for the old network device, but udev sees only the new device, giving it therefore the name eth1 instead of eth0. Delete that file and reboot the machine, the network device will come up as eth0, as it should be.

I am just now installing windows XP in that machine to find out if windows has problems with the ethernet card. So, I'll do what you suggest a little later.

onebuck 02-17-2013 11:09 AM

Member Response
 
Hi,

TobiSGD is correct but being Slackware 12;
Quote:

CHANGES_AND_HINTS.TXT

/etc/udev/rules.d/75-network-devices.rules
You can remove the '75-network-device.rules' then reboot and check it again.

Check the drivers and devices again to be sure.

stf92 02-17-2013 01:06 PM

Quote:

Originally Posted by onebuck (Post 4893715)
Hi,

TobiSGD is correct but being Slackware 12; You can remove the '75-network-device.rules' then reboot and check it again.

Check the drivers and devices again to be sure.

I removed 75-network-devices.rules and booted. Then in the booting messages it says:
Code:

Polling for DHCP server on interface eth0:
No carrier detected on eth0. Reducing DHCP time out to 10 seconds
dhcpcd: MAC address = some_address

Now ifconfig shows there is no conection with my ISP. It only shows the lo section. Besides 'links google.com' says 'Host not found'.

However, I booted in windows XP and had no problems connecting to Internet. The card is Realtek RTL8139, belonging to the RTL81 family. Obviously, XP has the correct driver.

onebuck 02-17-2013 01:45 PM

Member Response
 
Hi,

From Slackware 12 CHANGES_AND_HINTS.TXT
Quote:

Slackware's udev implementation will automatically create rules files for your optical devices (/etc/udev/rules.d/75-optical-devices.rules) and network interfaces (/etc/udev/rules.d/75-network-devices.rules) on first boot. If you add/remove/replace any of this hardware, and/or you "clone" a system to another hard drive for deployment, you will need to either remove these two files (so that udev will regenerate them to reflect the new/changed hardware) or edit them accordingly.

stf92 02-17-2013 01:56 PM

I already deleted /etc/udev/rules.d/75-network-devices.rules. It was the first thing I did. Now, is there a modules.conf in slackware 12.0? I can't find it.

stf92 02-17-2013 03:23 PM

Problem solved. In directory /etc/rc.d/ I have rc.inet1.conf and rc.inet1.conf.new. In the former, I had USE_DHCP[0]="yes". In the latter, I had USE_DHCP[0]="". Here I replaced "" by "yes" and voila: I had Internet!

tallship 02-18-2013 02:19 AM

when this happens, you can make sure whether everything is fired up and the way you want it at the higher levels. i.e.,

Once you ran your ifconfig it showed that you had eth0 up. Well, in your case it was eth1.

Consulting your rc.inet1 would be the next logical thing to look at, from the top and working your way down to lower level lsmod and lspci. The following could have sufficed to connect you up in a jiffy while affecting the edits for the next reboot:

Code:

# ip address show # 'ip a', 'ip addr', etc.
# ip route show # 'ip r'
# ip n # look around for friends in the neighborhood
# ip link set eth0 up
# ip addr add 192.168.1.177/24 dev eth0 # pick something not likely to conflict w/other hosts on local subnet
# ip route add default via 192.168.1.1

or alternatively,

Code:

# ifconfig -a
# route -n
# ifconfig eth0 up
# ifconfig eth0 192.168.1.177 netmask 255.255.255.0
# route add default gw 192.168.1.1
# arp -an # look around for friends in the neighborhood

dmesg, lshw, and bmon are your friends too :)

I don't waste my time thinking about whether one method is deprecated or not. They both mix and match equally well so it's more a mood or display thing to me. i.e., I prefer the output from the route command.

First and foremost, you determine if you initially have a problem by:

Code:

$ ping -c1 yahoo.com
$ ping -c1 8.8.8.8
$ ping -c1 <your-host-name>
$ ping -c1 <your-ip-address>
$ ping -c1 localhost

Which tells you where the failure is if it is in the IP stack or DNS/hosts/NIS - for example, let's say you aren't able to resolve your own hostname, or that of yahoo, but localhost and the IP addresses are reachable, so the first place you may want to look is in your /etc/hosts, /etc/resolv.conf, and /etc/nsswitch.conf.

If you can ping localhost and your own hostname but nowhere else, then perhaps:

Code:

# route -n
# iptables -L

is in order. The actual ICMP error messages will help guide you too.

I hope that helps!

Kindest regards,

.

.

stf92 02-18-2013 04:14 AM

Thanks, tallship, for your post. By the way, I notice the IP of one of the hosts changes once in a while, which forces me to modify the /etc/hosts files accordingly. For example, I have in /etc/hosts, in the server, lets call it so,
Code:

192.168.0.100      LOCAL_HOST.DN2  LOCAL_HOST
which is the other computer (lets call it local host). So
from the server I do 'slogin LOCAL_HOST' and I get connected. But may be later I turn off the local computer and on again. And doing ifconfig in it, I find the ip is no longer 192.168.0.100 but 192.168.0.102 (that is, ifconfig gives 'inet 192.168.0.102'). So 'slogin LOCAL_HOST' does not find the route. Of course, I then edit the server's /etc/host changing the ip to the new ip. But this is rather upsetting. Is there a way to make those ip's static?

onebuck 02-18-2013 09:19 AM

Member Response
 
Hi,

In your '/etc/rc.d/rc.inet1.conf' you are using 'DHCP' if you want the IP to remain the same then assign a static IP for the device(s).


All times are GMT -5. The time now is 01:34 PM.