Installing OpenSLP on Linux
Installing the latest distribution of OpenSLP is easy. Pay attention to the following steps and you should not have any problems.
- RPM Installation
- Download the latest RPM file from www.openslp.org. Select the appropriate distribution.
- Become root (root is usually the only user that can install packages).
- Install the package. This is typically done with:
- Make any configuration changes to the /etc/slp.conf file that you think you need. (see Configuration for details)
- Set up static registrations in the /etc/slp.reg file if you need them. (see Static Registrations for details)
- Start the OpenSLP daemon.
- Tarball Installation
- Download the latest tarball(.tar.gz) file from the openslp.org downloads page.
- Unzip and untar the file into an appropriate directory.
- Become root (root is usually the only user that can install daemons and libraries).
- Enter the extracted openslp directory build and install the OpenSLP binaries:
- Make any configuration changes to the /etc/slp.conf file that you think you need. (see Configuration for details).
- Set up static registrations in the /etc/slp.reg file if you need them. (see Static Registrations for details).
- Start the OpenSLP daemon.
- Make slpd start on boot:
- You may want to make a few changes to your Linux initialization scripts so that slpd will start when your machine is booted. Since it is not always necessary to have slpd running, you should probably read about when (and why) the OpenSLP daemon has to run in the Advanced Topics section before deciding to changing your init scripts.
- Remove the distribution directory from your system.
- Unless you will be doing OpenSLP development work, you will probably want to remove the distribution directory from your system after OpenSLP is installed. The distribution directory is the one that was created by the tar -zxf openslp-x.x.x.tar.gz command. During installation, all of the important files were copied out of this directory to the appropriate places on you machines file system so it can be deleted with out breaking your installation of OpenSLP.
- Add multicast or broadcast routes if necessary.
- Some operating systems (like Linux) require a route to be set so that the
host knows which interface should be used to send multicast and general
broadcast traffic. Most of the time, the default route will be sufficient.
# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.100.2 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 188.8.131.52 0.0.0.0 UG 0 0 0 eth0With the routing table above all multicast and general broadcast will be sent on eth0 (the 0.0.0.0 route is the default route.)
If you do not have a default route or you have a multi-homed host, you will have specify which interface should be used. The following is an example of a routing table from a multihomed host:
# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.131.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 184.108.40.206 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 220.127.116.11 0.0.0.0 UG 1 0 0 eth0Notice the default route? This means that multicast traffic will be sent to eth0. If I don't want multicast traffic to be sent to eth0 I will need to add a special route.
# route add -net 18.104.22.168 netmask 240.0.0.0 dev eth1 # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.131.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 22.214.171.124 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 126.96.36.199 0.0.0.0 240.0.0.0 U 0 0 0 eth1 0.0.0.0 188.8.131.52 0.0.0.0 UG 1 0 0 eth0Now multicast will be sent on eth1 not eth0.
To my knowledge, there is no way to send multicast traffic both eth1 and eth0 (at least with Linux) without specialized routing software. Some multihomed machines have NICs that are attached to the same network. In this case, there is usually no need to send multicast on both NICs. If you need specialized routing software take a look at mrouted.
- Testing to see if your installation of OpenSLP works.
- The OpenSLP distribution contains a handy command line tool that allows you
to perform most SLP functions from the command line. The tool is called
slptool and is built and installed by the OpenSLP make files. Look for
SLP tool in /usr/bin, /usr/local/bin, or <openslp_source_dir>/slptool/.
After you have started slpd, you should be able to issue a query for SLP
service agents using the following command line.
$ slptool findsrvs service:service-agent
The results of this command should be a list of the hosts that are running slpd. This indicates that OpenSLP is successfully installed and working. If you do not get any output, then OpenSLP is not installed correctly or is not working. If this happens, please double check that you followed build and installation instructions, and read the FAQ. If this does not help, post to the openslp-users mailing list with as much detail as you can provide.
- rpm -Uvh openslp-x.x.x.rpm
- tar -zxf openslp-x.x.x.tar.gz
- su root
- make install