[X-Unix] Apache & ifconfig

Pedro fp lists at pedro.Net.au
Sun Oct 17 23:35:20 PDT 2004


G'day Folks

Still working my way through Apache The Definitive Guide. I expect I'll 
run into quite a few question areas as I do so I hope you'll all bear 
with me.

On p51 [for those who have the book] ATDG describes setting up network 
drivers for multiple IP addresses. Following that I ran the following 
configuration commands to add IP addresses ...

Mars:~ pedro$ sudo ifconfig en1 192.168.18.1 alias netmask 0xFFFFFFFF
Mars:~ pedro$ sudo ifconfig en1 192.168.18.2 alias
<snip>
Mars:~ pedro$ sudo ifconfig en1 192.168.18.202 alias

After running configuration commands ...

Mars:~ pedro$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
         inet6 ::1 prefixlen 128
         inet6 fe80::1 prefixlen 64 scopeid 0x1
         inet 127.0.0.1 netmask 0xff000000
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         ether 00:0d:93:66:c1:44
         media: autoselect (none) status: inactive
         supported media: none autoselect 10baseT/UTP <half-duplex> 
10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 
100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX 
<full-duplex,hw-loopback>
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         inet6 fe80::20d:93ff:fe7f:faea prefixlen 64 scopeid 0x5
         inet 10.0.1.2 netmask 0xffffff00 broadcast 10.0.1.255
         inet 192.168.18.1 netmask 0xffffffff broadcast 192.168.18.1
         inet 192.168.18.2 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.11 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.12 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.13 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.14 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.101 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.102 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.201 netmask 0xffffff00 broadcast 192.168.18.255
         inet 192.168.18.202 netmask 0xffffff00 broadcast 192.168.18.255
         ether 00:0d:93:7f:fa:ea
         media: autoselect status: active
         supported media: autoselect
fw0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 2030
         lladdr 00:0d:93:ff:fe:66:c1:44
         media: autoselect <full-duplex> status: inactive
         supported media: autoselect <full-duplex>

With that I edited the hosts file so that it looks like this ...

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1			localhost
# Personal.
192.168.18.1		pedro.Mars.local
192.168.18.2		plowman.Mars.local
# Mates.
192.168.18.11		shakti.Mars.local
192.168.18.12		dogsballs.Mars.local
192.168.18.13		inhand.Mars.local
192.168.18.14		gloria.Mars.local
# Clients.
192.168.18.101		dollar.Mars.local
192.168.18.102		flowers4u.Mars.local
# Tests & other things.
192.168.18.201		wda.Mars.local
192.168.18.202		tests.php.Mars.local
255.255.255.255	broadcasthost
::1             localhost

Part of my planning has been to group IP addresses for different 
purposes leaving generous gaps for addresses to be added later.
At this stage I have 2 questions ...
1. Should I have done anything differently?
2. To what file do I add the ifconfig commands so that they run at 
startup? ATDG suggests /etc/rc.local but that doesn't exist on OS X.

TIA & cheers, Pedro :-)



More information about the X-Unix mailing list