Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 1997 01:25:39 +0800 (SGT)
From:      sweeting@tm.net.my
To:        freebsd-questions@freebsd.org
Subject:   [Q] proper way to configure startup scripts for tcp/ip ?
Message-ID:  <v01540b05af636c34cfa1@[202.184.153.110]>

next in thread | raw e-mail | index | archive | help
I previously installed FreeBSD over a network on 2 machines
without any trouble whatsoever. As part of that installation process,
tcp/ip was configured via the installation menu and configuration
files (e.g /etc/resolv.conf) created autmatically.

I have now installed FreeBSD via CD ROM on another machine
and then  configured tcp/ip manually - i kept getting
"network unreachable" errors on bootup (using 3com NIC)
but managed to cure it with the following :

[/etc/resolv.conf]
domain             hell.com.my
nameserver      202.184.153.3

[/etc/host.conf]
bind
hosts

[/etc/hosts]
127.0.0.1       localhost       localhost.hell.com.my

[/etc/sysconfig]
hostname="devil.hell.com.my"
defaultdomainname="NO"
network_interfaces="lo0 ep0"
ifconfig_lo0="inet localhost"
ifconfig_ep0="inet 202.184.153.13 netmask 255.255.255.0"
# ifconfig_ep0="inet 202.184.153.5  netmask 255.255.255.255 alias"
# ifconfig_ep0="inet 202.184.153.30 netmask 255.255.255.255 alias"
# ifconfig_ep0="inet 202.184.153.31 netmask 255.255.255.255 alias"
static_routes=""
router="NO"


Now, this works OK but I was trying to get virtual domains to work and
found that if i uncomment the ifonfig aliases in /etc/sysconfig above,
nothing works at all... (yet I saw a reference to doing ifconfig aliasing
in /etc/sysconfig in an earlier post)

So, I have created a simple script to do the aliasing :

ifconfig ep0 202.184.153.5 netmask 255.255.255.255 alias
ifconfig ep0 202.184.153.30 netmask 255.255.255.255 alias
ifconfig ep0 202.184.153.31 netmask 255.255.255.255 alias
route add -host 202.184.153.13  127.0.0.1
/usr/local/sbin/httpd

This works but is it the proper way to go about this ?
How can i invoke my script automatically at start up ?
(simply append to /etc/sysconfig ?)

Should I incorporate that route command into the sysconfig file ?
eg. static_routes="202.184.153.13 127.0.0.1"


And since just to clean things up,  freebsd calls httpd on bootup
and fails (since the ip aliases are not set) ... where can i comment
that out ? (i tried rc.local, rc*, inetd.conf)

Thank you very much for any help.

chas














Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v01540b05af636c34cfa1>