Proxy By Hostname Configuration

  • Adding a Second IP Address to a Network Adapter on Linux

Adding a Second IP Address to an Existing Network Adapter on Linux

Why Is This Important?

Adding a second IP address to an existing network adapter allows you to...

If you run EZproxy on a Linux system that already has a web server and you want to use EZproxy on port 80, you will need to assign an additional DNS name and IP address to the server.

You may also need to add a second IP address for complex group configurations. See the Configuring Groups tab after you have added the second IP address to your web server.

Before Getting Started

Request a new DNS name and IP address from your network administrator. The IP address you request must be in the same subnet as the existing IP address on your server.

If you use the suggested proxy by hostname configuration, be sure to request the creation of a wildcard entry to point to the same address. With proxy by hostname, you should also verify that the DNS entries with the Check DNS test. If the new IP is to be 24.249.162.195 and the DNS name is to be  

In the following instructions, the DNS name ezproxy2.yourlib.org and the IP address 24.249.162.195 demonstrate where the DNS name and IP address should appear, and where you should insert your values instead.

Add an IP address for Non-SUSE distributions

These are the steps to add the second IP address to your existing network adapter under non-SUSE distributions of Linux.

1. Become root on your system, either by logging into that account or using the su command.


2. Change your current directory to the /etc/sysconfig/network-scripts directory with the command:

cd /etc/sysconfig/network-scripts

3. Check for existing network adapters with the command:

ls ifcfg-*

In most instances, you will see the files ifcfg-eth0 and ifcfg-lo. If you see other files with any other names and are unfamiliar with configuring TCP/IP, you may want to consult with your system administrator before proceeding or contact support@oclc.org.


4. Edit /etc/hosts and add a line for your new address and name such as:

24.249.162.195 ezproxy2.yourlib.org

5. To create the new interface, you will copy ifcfg-eth0 to ifcfg-eth0:0 with the command:

cp ifcfg-eth0 ifcfg-eth0:0

6. Edit icfg-eth0:0 and change the DEVICE line to be similar to:

DEVICE= eth0:0

and change the IPADDR line to be similiar to:

24.249.162.195

7. To activate the new IP address, issue a command similar to:

./ifup eth0:0

Add an IP address for SUSE distributions

1. Become root on your system, either by logging into that account or using the su command.


2. Change your current directory to the /etc/sysconfig/network-scripts directory with the command:

cd /etc/sysconfig/network-scripts

3. Check for existing network adapters with the command:

ls ifcfg-eth*

and look for a file named similar to ifcfg-eth-id-12:34:56:78:90:ab. The colon-delimited letters and digits at the end are the MAC address (hardware address) of the Ethernet adapter.


4. Edit /etc/hosts and add a line for your new address and name such as:

24.249.162.195 ezproxy.yourlib.org

5. To create the new interface, you will edit ifcfg-eth-id-12:34:56:78:90:ab. The file should contain lines similar to:

BOOTPROTO='static'
BROADCAST='24.249.162.255'
IPADDR='24.249.162.194'
NETMASK='255.255.255.0'
NETWORK='24.249.162.0'
STARTMODE='onboot'
USERCONTROL='no'
_nm_name='bus-pci-0000:01:04.0'

and will contain additional lines. At the bottom of this file, you should add lines similar to:

IPADDR1='24.249.162.195'
NETMASK1='255.255.255.0'
LABEL1='0'

to add the extra address.


6.  To restart networking and activate the new IP address, issue the command:

/etc/init.d/network restart

Reconfigure EZproxy to use a specific IP address

To tell EZproxy to use this name and address, edit config.txt and add lines similar to:

Name ezproxy.yourlib.org
Interface 24.249.162.195

These lines should appear before any LoginPort, LoginPortSSL, or Title lines.

Reconfigure Apache to use a specific IP address

You will also need to configure your existing web server to tell it to use only its IP address. In Apache, you do this by editing httpd.conf and changing your Listen lines like:

Listen 80
to
Listen 24.249.162.194 :80

where 24.249.162.194 would be replaced by the main IP address of your server.

 

To use a second IP address in a Group configuration...