Mailinglist Archive: opensuse-security (192 mails)

< Previous Next >
Re: [suse-security] multiple ip adresses per network adapter?
  • From: Fred Mobach <fred@xxxxxxxxx>
  • Date: Mon, 08 May 2000 15:25:14 +0200
  • Message-id: <3916C03A.E3D7874C@xxxxxxxxx>
Heiko Nardmann wrote:

> 1) Is it possible to assign multiple ip adresses to a single
> network adapter?

Look at :

# procedure : virtual-host-config for
# target : virual hosting start /stop
# arguments : start / stop / restart
# author : Fred Mobach
# date : 13-09-1999

. /etc/rc.config


case "$1" in
echo -n "Starting virtual hosting."
/sbin/ifconfig eth0:0
/sbin/ifconfig eth0:1
/sbin/ifconfig eth0:2
/sbin/ifconfig eth0:3
/sbin/ifconfig eth0:4
/sbin/ifconfig eth0:5
/sbin/ifconfig eth0:6
/sbin/ifconfig eth0:7
/sbin/route add -host dev eth0:0
/sbin/route add -host dev eth0:1
/sbin/route add -host dev eth0:2
/sbin/route add -host dev eth0:3
/sbin/route add -host dev eth0:4
/sbin/route add -host dev eth0:5
/sbin/route add -host dev eth0:6
/sbin/route add -host dev eth0:7
echo -e "$return"
echo -n "Shutting down virtual hosting:"
/sbin/route del -host dev eth0:0
/sbin/route del -host dev eth0:1
/sbin/route del -host dev eth0:2
/sbin/route del -host dev eth0:3
/sbin/route del -host dev eth0:4
/sbin/route del -host dev eth0:5
/sbin/route del -host dev eth0:6
/sbin/route del -host dev eth0:7
/sbin/ifconfig eth0:0 down
/sbin/ifconfig eth0:1 down
/sbin/ifconfig eth0:2 down
/sbin/ifconfig eth0:3 down
/sbin/ifconfig eth0:4 down
/sbin/ifconfig eth0:5 down
/sbin/ifconfig eth0:6 down
/sbin/ifconfig eth0:7 down
echo -e "$return"
$0 stop && $0 start || return=$rc_failed
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1

test "$return" = "$rc_done" || exit 1
exit 0

Make some additional links to this file in /sbin/init.d/rc[2-3].d/ and it
will start and stop like other network services.

Will this do ?

> 2) If 1 is possible, then my next question is:
> is it possible to direct the requests to different processes
> listening to the same port?
> Maybe I should ask if it is possible to have different (ip-based)
> "port spaces" where different processes listen to the same port
> but for a different ip address?

Yes, that can be done. I've managed this with Apache with the Listen and
VirtualHost commands. It works also very well with rinetd (see freshmeat).


Fred Mobach

< Previous Next >