DHCP Server with DHCP Client NAT on Solaris 10
So you have at least two interfaces and their setup for dhcp client (the modem or wan) and dhcp server static ip (internal network).
So for this example I’ll use the following
eri0 dhcp client wan
eri1 dhcp server lan
now the eri0 requires dhcp
so were need
/etc/dhcp.eri0
/etc/hostname.eri0
leave them empty
next set your system hostname in
/etc/nodename
now for some reason solaris 10 want to make the dhcp client the
primary NIC and set the system name to the primary hostname
so nodename will be assigned to your hostname
hostname.example.com
now set the hostname for the static eri1
/etc/hostname.eri1
for this example it will be
hostname.example.com
so now we setup the /etc/inet/hosts (ipnodes /etc/hosts)
192.168.1.1 eri1
(replace with your ip)
setup your netmask
/etc/inet/netmasks
192.168.1.0 255.255.255.0
replace with your network and netmask
edit your host file for your ipaddresss
192.168.1.1 hostname.example.com
Now to keep it from editing the /etc/inet/host file every time it boots
destroying your settings (and the fact that you probably don’t want a hostname
associated with your external connection) edit the following line
vi /lib/svc/method/net-svc
filename=host
and change it to
filename=host.bad
now your good to go.
Your system will have the right hostname and all your other services should work
as well. This probably isn’t the best way but I spend several days trying to by pass this
one little line and ended up just changing it
you can write a script to check it easyier then you can write one to by pass it
just check it, fix it if it gets changed, best to run this check in rc1.d as to make sure its fixed
before its run.
Good luck
#!/usr/bin/bash
#Not tested good luck
PATH=/sbin:/usr/sbin:/bin:/usr/bin
VAR1=`grep “filename=host” /lib/svc/method/net-svc`
if [ $VAR1 == "filename=host" ]
cp /lib/svc/method/net-svc /lib/svc/method/net-svc.back
cp /lib/svc/method/net-svc /temp/net-svc
cat /temp/net-svc|sed s/”filename=host”/”filename=host.bad”/ > /lib/svc/method/net-svc
fi