H-Sphere Documentation Sysadmin Guide

For more information contact us at info@psoft.net

Configuring Unix IP Management Scripts

 

IP installation

Dedicated IP - supports automated addition and deletion of IP addresses. The ip-update script is used to add and delete IP addresses. This script is platform independed. All platform dependent functionality is moved into the ip-loader.pm script (FreeBSD, Linux).

This script has two functions: add and del. The first parameter is action (add or delete), the second is IP, and the third is mask (optional).

ip-update add 192.168.112.100 255.255.255.0 - adds IP 192.168.112.100 with mask 192.168.112.100

ip-update del 192.168.112.100 - deletes IP 192.168.112.100

To add an IP address, this script activates and writes IP in a file (default: /hsphere/local/rc.d/network/ips). To delete an IP address, the script deactivates and removes IP from the file. You can change the path to ips file in ip-loader.pm. To do this, you should change variable $conf_file and $lock_file. Also, you should change variable $conf_file inside the setup-ips.pl file.

The ip-loader.pm file consists of platform depended functions to activate and deactivate IPs in the system. For FeeBSD you should use the ip-loader.pm from the hsphere-scripts/FreeBSD/ directory.

The script uses by default eth0 (Linux) and rl0 (FreeBSD) interfaces for addition and deletion of IP addresses. You can change interface (variable $dev) to any other one. To change it, you should change the line marked as platform depended in the ip-loader.pm file. After reboot you should activate IPs. To do this, you can run the script setup-ips.pl. To automatically activate ips, you need to add this script to the startup script in your system. Also, by default the script uses the ifconfig command without a path. If you want to use a path, you should change variable $ifconfig in all scripts described above.

If you have other IP aliases and you want to activate them after system startup, you should either add them to the file ips or use the script ip-update to add your IP aliases.



Home   Products   Services   Partners   Support   News   Contact   Forum
© Copyright 1998-2003. Positive Software Corporation.
All rights reserved.