Using Solaris 10 as DHCP client

Today I just wanted to document here the quickest and easiest way of setting your Solaris box as a DHCP client.

1. Create the /etc/hostname. file

For instance:

solaris# touch /etc/hostname.skge0

2. Create the /etc/dhcp. file

It can be an empty file, but you can also use it to specify how long ifconfig should be waiting for a DHCP-server reply before giving up and continuing with Solaris boot.

solaris# cat /etc/dhcp.skge0
wait 60

3. Specify your  system name

It has to be specified in /etc/nodename. This name is going to be used as your hostname in case your DHCP-server does not return your hostname in reply to your DHCP-request.

THat’s all. Reboot your system, and it all should work! Enjoy! 🙂

Comments

  1. Steven Gelsie says:

    Here is the process of setting up a Solaris 10 DHCP client

    1) Find you what network interface you are using

    ifconifg -a

    2) Create a /etc/dhcp.[network interface_name] file

    ex:touch /etc/dhcp.e1000g0

    3) Edit the /etc/hostname.[network_interface]

    This should be one line either just host name if your NOT using
    dynamic DNS update or “inet host name” if you are using dynamic DNS.

    [host name]

    or

    inet [host name]

    4) Create of edit the /etc/nodename file

    This should have your host name

    5) Edit the /etc/host file

    This should NOT for your host name. DHCP will put an
    entry in for you host.

    6) If you are using dynamic DNS to with DHCP you have to edit the
    /etc/default/dhcpagent file. Set

    REQUEST_HOSTNAME=yes

    7) Configure your network interface to use DHCP

    ifconfig [network interface] dhcp start

  2. Mike Stewart says:

    Absolutely perfect! Many thanks.

  3. To set the hostname and make it stick and register during dhcp, add the wanted hostname to /etc/hostname. as below:

    inet hostname

    Then it’ll do the right thing under Solaris 10

  4. kowalski007 says:

    Hello, thanks for the help!

    My problem is that I have 2 network interfaces, in my VBox VM, so one of them is on NAT and the other is with a Host Only Adapter, this have a static ip, and i can use SSH over this IP, but the other (the NAT) is to provide Internet access to my VBox VM, I followed this steps:

    1.- Added my “hostname” in the file /etc/hostname.e1000g0 and the word “inet” before the hostname, like this:

    inet myhostname

    2.- Edited the /etc/dhcp.e1000g0, added the next to this file:

    wait 30
    primary —> (This is to set as the primary NIC)

    And after a reboot I get this messages:

    hostname: unknown

    WARNING: loghost could not be resolved

    • kowalski007 says:

      I will response to my question… (is anybody there?, I guess no, cause this is an older post, doesn’t matter!)

      Ok, i just created a file /etc/nodename, and added my hostname on it. Yeah!

      And then, I added “loghost” in the /etc/hosts file, like this

      my-ip-address my-hostname loghost # Added by dhcp

      That’s all!

Speak Your Mind

*