Switching from DHCP to Static IP

Hi, I'm trying to switch my Solaris 10 box from DHCP to static IP. It worked out of the box with DHCP. I've read through the forums and googled, and I think I'm almost there, but not quite.

My network interface is bge0; the desired IP is 192.168.2.5 with hostname server2; and the router is 192.168.0.1.

So far, what I've done is:

- Renamed /etc/dhcp.bge0 to /etc/dhcp.bge0.backup

- Added the line "192.168.2.5server2" to both /etc/hosts and /etc/inet/ipnodes, and deleted the line generated by dhcp.

- Made a new file '/etc/nodename' and put the word server2 in it.

- Made a new file /etc/defaultrouter' and put the router address 192.168.0.1 in it.

- Edited the empty file '/etc/hostname.bge0' and put the address 192.168.2.5 in it.

After rebooting, 'ifconfig bge0' gives the following output

bge0: flags=1000843<up, BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 192.168.2.5 netmask ffffff00 broadcast 192.168.2.255 ether 0:1b:24:1d:f3:1c

Thanks for any help!

Edit: Changed some wording, added output of ifconfig

[1126 byte] By [Blazeixa] at [2007-11-27 6:53:22]
# 1
Take the easy way out.man sys-unconfigalan
alan.paea at 2007-7-12 18:28:07 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2
Hello.And what exactly does not work?According to the output of "ipconfig" your system should work correctly.Martin
Martin_Rosenaua at 2007-7-12 18:28:07 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3
I cannot connect to the internet. I can ping the router (192.168.0.1) but cannot connect outside.I read through sys-unconfig, and it seems like it would just delete all the changes I've made. Would it then revert back to DHCP? Thanks for any help.
Blazeixa at 2007-7-12 18:28:07 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4
Try it.Find out, by going through its steps.Then come back here and report what you observed.That way, you'll be teaching others what to expect.
rukbata at 2007-7-12 18:28:07 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5

Your router is incorrect for your subnet mask. You have netmask of 255.255.255.0 and IP address is 192.168.2.5. Your router 192.168.0.1 should be in the 192.168.2.0 subnet not 192.168.0.0.

Maybe it is your netmask that needs to change. If so put the correct entry in /etc/netmasks.

Regards

Stuart_Flishera at 2007-7-12 18:28:07 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 6

Thanks, I just added the line "192.168.0.0255.255.0.0" to /etc/netmasks, and now I can make outside connections.

After doing this I had an odd problem I'd never experienced before. Somehow my DNS was off. I could visit webpages by IP, for example, if I typed 64.233.167.104 into my browser it went to google, but I could not get to google by typing 'www.google.com.' I fixed this by adding the word 'dns' to the end of the line "hosts: files" in nsswitch.conf

Thanks for all your help!

Blazeixa at 2007-7-12 18:28:07 > top of Java-index,Solaris Operating System,Solaris 10 Features...