2 ip #'s, one net, one machine?

2 ip #'s, one net, one machine?

Post by mendels.. » Sun, 17 Sep 1995 04:00:00



Hi,
  I was wondering whether it was possible to assign two IP
#'s in the same network, eg 234.234.234.1 and 234.234.234.128 to
the same machine.  I believe that this can be done only with
some kind of modification to the networking code.  It will prove
useful for a machine running httpd serving up more than one
web site (www.x.org and www.y.org could be assigned two different
#'s which would then reference one machine).  Does anyone have
any ideas?  Thanks,
andy mendelsohn
?
 
 
 

2 ip #'s, one net, one machine?

Post by Bob Hau » Sun, 17 Sep 1995 04:00:00


|>   I was wondering whether it was possible to assign two IP
|> #'s in the same network, eg 234.234.234.1 and 234.234.234.128 to
|> the same machine.  I believe that this can be done only with
|> some kind of modification to the networking code.  It will prove
|> useful for a machine running httpd serving up more than one
|> web site (www.x.org and www.y.org could be assigned two different
|> #'s which would then reference one machine).  Does anyone have

I have done this using the 'dummy' module.  Works great.  No mods
to the kernel required.  This module is included with 1.2.x kernels.

Get 'httpd-1.4.1-multidomain' from sunsite.unc.edu.  I think it is
in system/Network/info-systems.  The included docs describe the
procedure for installing the dummy driver and setting up httpd to
serve multiple domains.

---
 Bob Hauck                              Wasatch Communcations Group


 
 
 

2 ip #'s, one net, one machine?

Post by John Lell » Mon, 18 Sep 1995 04:00:00


: Hi,
:   I was wondering whether it was possible to assign two IP
: #'s in the same network, eg 234.234.234.1 and 234.234.234.128 to
: the same machine.  I believe that this can be done only with
: some kind of modification to the networking code.  It will prove
: useful for a machine running httpd serving up more than one
: web site (www.x.org and www.y.org could be assigned two different
: #'s which would then reference one machine).  Does anyone have
: any ideas?  Thanks,
: andy mendelsohn
: ?

Use the dummy device driver, dummy.o, for one of the IP addresses.  That's
what it's for!  Try:

        ifconfig eth0  234.234.234.1   up netmask 255.255.255.0
        ifconfig dummy 234.234.234.128 up netmask 255.255.255.0

If you need more than one dummy device, load it as a module instead of
specifying it in your 'make config'.  Works fine here.

--


--
... Our continuing mission: To seek out knowledge of C, to explore
strange UNIX commands, and to boldly code where no one has man page 4.

 
 
 

2 ip #'s, one net, one machine?

Post by Thomas Lars » Wed, 20 Sep 1995 04:00:00


: I have done this using the 'dummy' module.  Works great.  No mods
: to the kernel required.  This module is included with 1.2.x kernels.

Does the dummy module allow you to assing multiple adresses to it, or
just one? I want to be able to assign lots of (10+) adresses to one
interface, preferably in the 1.3.x kernel, and since IPALIAS doesn't work
with any other kernel than 1.2.1, this seems like another option.

: Get 'httpd-1.4.1-multidomain' from sunsite.unc.edu.  I think it is
: in system/Network/info-systems.  The included docs describe the
: procedure for installing the dummy driver and setting up httpd to
: serve multiple domains.

I've done this, but there is no docs describing how to set up Linux for
this, just the httpd. Since I'm using Apache, I don't need the httpd, but
I need some docs on how to do this on Linux.

Has anybody considered making a mini-HOWTO on this. It seems like a lot
of people are wondering about this, but no one can give a straight answer.

Thomas Larsen

 
 
 

2 ip #'s, one net, one machine?

Post by John Lell » Thu, 21 Sep 1995 04:00:00



: : I have done this using the 'dummy' module.  Works great.  No mods
: : to the kernel required.  This module is included with 1.2.x kernels.

: Does the dummy module allow you to assing multiple adresses to it, or
: just one? I want to be able to assign lots of (10+) adresses to one
: interface, preferably in the 1.3.x kernel, and since IPALIAS doesn't work
: with any other kernel than 1.2.1, this seems like another option.

You can reuse dummy.o as many times as you need to if you insert it as a
module:

        insmod -o dummy0 dummy.o
        insmod -o dummy1 dummy.o
        insmod -o dummy2 dummy.o
        insmod -o dummy3 dummy.o
        insmod -o dummy4 dummy.o

and so forth...

--


--
... Our continuing mission: To seek out knowledge of C, to explore
strange UNIX commands, and to boldly code where no one has man page 4.

 
 
 

1. Ip Route equalize w/ one machine via one ISP

I've got 2 DSL's lines I'm attempting to load balance.  I seem to have it
working but I want to add one more thing.  I want 10.0.2.252 to just go out
over eth0, ie., I don't want that machine to use the load balancing.
10.0.2.254 is the gateway.

INTERF0="eth0"
INTERF1="eth1"
NTSERV="10.0.2.252"

LOCALIP0=`cat /etc/dhcpc/dhcpcd-eth0.info | grep IPADDR | cut -c8-21`
LOCALIP1=`cat /etc/dhcpc/dhcpcd-eth1.info | grep IPADDR | cut -c8-21`

# Clear old masq's / forwards

${NET}/iptables -L -t nat
${NET}/iptables -F -t nat
${NET}/iptables -F INPUT
${NET}/iptables -F OUTPUT
${NET}/iptables -F FORWARD
${NET}/iptables -t nat -F POSTROUTING
${NET}/iptables -t nat -F PREROUTING

#  Setup IP Masq
echo 1 > /proc/sys/net/ipv4/ip_forward

ip rule add from XXX.XXX.253.158 lookup 1 dev eth1
ip route add 10.0.0.0/24 via 10.0.2.254 table 1
ip route add 0/0 table 1 dev eth1

ip rule add from XXX.XXX.253.52 lookup 2 dev eth0
ip route add 10.0.0.0/24 via 10.0.2.254 table 2
ip route add 0/0 table 2 dev eth0

ip route add default equalize \
   nexthop via XXX.XXX.253.1 dev eth1 \
    nexthop via XXX.XXX.253.1 dev eth0

${NET}/iptables -t nat -A POSTROUTING -o ${INTERF0} -j SNAT --to
${LOCALIP0}
${NET}/iptables -t nat -A POSTROUTING -o ${INTERF1} -j SNAT --to
${LOCALIP1}

If I add a 3rd table/lookup for 10.0.2.252 and then try to add a default
route for it.  I get a msg that it already exists???

TIA,
Mark

2. Test

3. two IP's on one machine using two differnet NIC's

4. Help: gtk-config error?

5. setup one interface for 'up' and another one for 'down'

6. Testing for keyboard input

7. Sendmail on two IP's (one machine)

8. PPP problem, pls help

9. 2 IP's one machine....HELP!!!!!!!!

10. multiple ip's on one machine and sendmail

11. multiple ip's and subnet on one machine

12. Challenge: 'ln' one liner to merge one directory tree into another?

13. Setting up SLIP, Ping only works one one of the machines