[3567] in linux-net channel archive
Re: Multiple IP's
daemon@ATHENA.MIT.EDU (Andrew B. Cramer)
Tue Jul 2 22:52:18 1996
Date: Tue, 2 Jul 96 18:45 CDT
To: "James R. Paton" <patonj@interdart.co.uk>
From: "Andrew B. Cramer" <cramer@ripco.com>
Cc: linux-net@vger.rutgers.edu
Hi James,
To do the upgrades for Slackware 3.0 to Linux 2.0 please find the
information at 'http://www.cris.com/~hallow/linux'. This is a good outline
about upgrading to 2.0, it worked for me. and my rc.inet1 follows. You will
find 3 additional ip's after the initial definition. Just use ipconfig and
it will list the aliased ip's but won't show that they go to a NIC. It works
anyway. This is a good way to get multiple ip's for Apache Web Server. Any
more questions, just ask. - Andy
------------------------------rc.inet1----------------------------------
#! /bin/sh
#
# rc.inet1 This shell script boots up the base INET system.
#
# Version: @(#)/etc/rc.d/rc.inet1 1.01 05/27/93
#
HOSTNAME=`cat /etc/HOSTNAME`
# Attach the loopback device.
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0
# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the
# eth0 interface. If you're only using loopback or SLIP, don't include the
# rest of the lines in this file.
# Edit for your setup.
IPADDR="192.168.86.20" # REPLACE with YOUR IP address!
IPADDR1="192.168.86.21" # alias 1
IPADDR2="192.168.86.22" # alias 2
IPADDR3="192.168.86.23" # alias 3
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
NETWORK="192.168.86.0" # REPLACE with YOUR network address!
BROADCAST="192.168.86.255" # REPLACE with YOUR broadcast address, if you
# have one. If not, leave blank and edit below.
GATEWAY="192.168.86.1" # REPLACE with YOUR gateway address!
# Uncomment ONLY ONE of the three lines below. If one doesn't work, try again.
# /sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
# /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK}
#
# These are the alias ip's
#
/sbin/ifconfig eth0:0 ${IPADDR1} netmask ${NETMASK}
/sbin/ifconfig eth0:1 ${IPADDR2} netmask ${NETMASK}
/sbin/ifconfig eth0:2 ${IPADDR3} netmask ${NETMASK}
# Uncomment these to set up your IP routing table.
/sbin/route add -net ${NETWORK} netmask ${NETMASK}
/sbin/route add default gw ${GATEWAY} metric 1
# End of rc.inet1
----------------------------------end of rc.inet1---------------------------
+------------- cramer@ripco.com -------------+
| Andrew B. Cramer |
| (312)-283-0234 |
+--------------------------------------------+