Advertisement

Saturday, January 11, 2014

First Attempt to Install Avahi Server at Star

I brought the Raspberry Pi with Avahi to Star this morning and installed it on the school's network.  I connected it to port 4 on the middle switch.  It fired right up.

Before I came, I changed the network settings to use DHCP.  That way, I could be sure it would work on the network.

Also, I created a user account on the Pi named startech.  It has the usual Star administrator password.  The user has the ability to execute sudo commands as well.

After the pi booted up, I was able to ping it at star-avahi.local.  That is the device's hostname.

I also used ssh to successfully log in to star-avahi.local from my laptop.

PTL.  Everything works so far.

Now, the fun starts and by fun, I mean frustration.

After I got here, Bob gave me 192.168.96.39 to use as a permanent IP address.  I changed the /etc/network/interfaces file to use a static ip address with that number.  I could not ping the device or see it on the network after that.

I took the Pi into the office so I could login to it directly.  I changed the network settings to comment out the fixed IP lines for network and broadcast and rebooted.  Then, I could see the device on the network using its IP address but not with the host name of star-avahi.local.  Using DHCP to get an IP address did not help with the hostname either.  I don't know why avahi is not working now that I am in the office.

Bob and I talked and agreed to use "exodus" as the hostname.  I modified the /etc/hostname file to use exodus.  Then, I tried editing the host file.  Nano never opened up.  I had to use the three finger salute and reboot the device.  I was able to change the host file after that.  Now, the device is named "exodus".

Getting back to avahi, I gave the device a fixed IP address.  The interfaces file now has lines like this:
iface eth0 inet static
    address 192.168.96.39
    netmask 255.255.254.0
    gateway 192.168.96.1

Rebooted.  Pinging 192.168.96.39 works.  Pinging exodus.local times out.  The hostname is not found.

Nmap sees 192.168.96.39 but does not return a hostname.

Executed sudo /etc/init.d/avahi-daemon restart.  Still can't ping using the exodus.local host name.

I moved the pi back into the workroom and plugged it in to the network.  I could not ping either exodus.local nor 192.168.96.39.  Nmap does not see the .39 address on the network.

Moved the pi back to the office.  I could then ping with the local ip address only.  Not with the host name.  Nmap can see the .39 address as well.

So, when using a fixed IP address, I can see the pi when it is plugged in to a network port in the office but not in the workroom.  The pi was plugged into switch port four on the middle switch.

I moved the pi back to the workroom and plugged it in to the same port that the PC in the office was using.  Now, I can ping the IP address but I still can't ping the hostname.  Nmap sees the .39 address.

So, something about port 4 on the middle switch does not let me ping the pi when it has a fixed IP address.

Next, I used ssh to connect to the pi in the workroom.  I changed the network settings to use DHCP instead of a fixed IP address and rebooted.  Nmap did not see the pi on the network.  I could not determine its IP address.

Brought the device back to the office using the same network port on the switch that I used while in the workroom.  It reported an ip address of 192.168.97.14.  That is why Nmap did not see it before.  I was looking for IP addresses on the .96 subnet.  Ran Nmap on the .97 subnet and I do see IP address .14 but it does not have a hostname.  Still can not ping the host name.  I can ping the IP address.

Brought the device back to the workroom using the switch port that is normally used in the office.  I was able to ping 192.168.97.14.  Still can not ping the host name.  Nmap does see the device at 192.168.97.14 but it has no host name.

Next, I moved the device to the middle switch, port 4.  The pi is still setup for DHCP.  Cycled power.  Nmap shows a new device at 192.168.96.16.  One time it gave a hostname for that IP of Jericho.  One time as Genesis.  If I ping jericho.starlocal.org, there is a response from both jericho.starlocal.org and genesis.starlocal.org on IP 192.168.96.16.

Something is definitely squirrelly with port 4 on the middle switch.  It must be setup specifically for some host or IP address.

Plugged the pi into port 9 on the top switch.  It got an IP address of 192.168.97.137.  Still can't  ping exodus.local.  Was able to ssh using the ip address.

I changed the host name in the hostname and hosts files back to star-avahi and rebooted the pi.  Can't ping or ssh to the star-avahi.local host name.

Changed the host name in the hostname and hosts files back to exodus and rebooted.  The IP address when back to 192.168.97.14.  Tried stopping and starting the avahi service with service avahi-daemon stop and then start.  That did not help.

Used sudo apt-get purge to uninstall Avahi.  Then, ran sudo apt-get update.  After that the pi started reacting very sluggishly.  I had to cycle power.  I still could not see the pi after that.  nmap could not see any network devices on the 96 nor 97 subnet.  Its like the network went down or my laptop lost its IP address.  I cycled power on the devices in the cabinet in the workroom but that did not help.  My laptop could not connect to the wireless network.

I plugged it in to a hard line and it got on the network.  Not sure what happened.

That's it for one day.

No comments:

Post a Comment