Search This Blog

01 August 2008

Setting up a static network configuration with NWAM

Step 1: Figure out which network interface to use...

malachi@serveris:/etc/nwam# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
nge0: flags=201004843 mtu 1500 index 12
    inet 10.10.1.155 netmask ffffff00 broadcast 10.10.1.255
    ether 0:18:f3:d5:cd:9b
nge1: flags=201000802 mtu 1500 index 13
    inet 0.0.0.0 netmask 0
    ether 0:18:f3:d5:cd:9c
lo0: flags=2002000849 mtu 8252 index 1
    inet6 ::1/128


Step 2: Setup the nameservers....
gedit /etc/resolv.conf
add in the DNS servers...
EX:
nameserver 10.10.1.1
nameserver 66.93.87.2
nameserver 216.231.41.2


Step 3: Switch to using the DNS servers...
malachi@serveris:/etc# cp nsswitch.conf nsswitch.conf.original
malachi@serveris:/etc# cp nsswitch.dns nsswitch.conf
malachi@serveris:/etc# svcadm restart svc:/network/dns/client:default

Step 4: Switch to a static IP
gedit /etc/nwam/llp
change the 'nge0 dhcp' (or whatever device from Step 1) to 'nge0 static 10.10.1.10/24' (or whatever ip)

svcadm restart svc:/network/physical:nwam

9 comments:

  1. On reboot it complained that serveris was not in the /etc/hosts file, so I just added the line '10.10.1.10 serveris' and all seems fine now.

    ReplyDelete
  2. also, should do:

    # pfexec svcadm enable svc:/network/physical:default

    # pfexec vi /etc/defaultrouter
    (add '10.10.1.1' on its own line)

    # pfexec svcadm restart network/routing-setup

    ReplyDelete
  3. Excellent, thanks for that. I've just installed an OpenSolaris 2008.11 box and wondered why when setting /etc/nwam/llp to have a static address, DNS didn't see to work anymore!

    Lifesaver!

    ReplyDelete
  4. very cool procedure! thanks! I'm happy that found your blog:)

    ReplyDelete
  5. You would think it would be easier, but...


    Glad it helped! :)

    ReplyDelete
  6. Thanks mate...saved me a world of pain.

    ReplyDelete
  7. no problem. happy to be of assistance.

    ReplyDelete
  8. Thanks!
    Funning thing is: why isn't this not in a manpage?

    ReplyDelete
  9. Good point. Maybe we should recommend updating the nwam man page

    ReplyDelete