Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to change the IP address in Solaris, but am failing to do so.

The IP address needs to be a fixed number, like 10.0.11.10

I have tried changing the IP address in /etc/hosts which I changed the hostname and the IP address, but when I try ping the computer name, it says:

Ping request could not find host SolarisTest. Please check the name and try again.

I have done what they told me to try on this site. But still stuck.

They say to do this: "If using Solaris 9 or above, users may need to edit the IP address in /etc/inet/ipnodes" which I did, and the file looks exactly the same as the /etc/hosts/ file. I already changed the IP address in the /etc/hosts/ file.

  • Please can someone show me how to change the IP address on Solaris 11?

Edit

I have tried ifconfig -a and it showed me the old IP address 10.0.10.80 and I changed /etc/hosts/ to show 10.0.11.10 - so I have no idea why it is always changing.

2nd Edit

This link also shows stuff about how to change the IP address, as I have tried that as well, and also got nowhere.

share|improve this question
    
If ifconfig still shows the old address, you didn't follow that article you link to. /etc/hosts is only for host name resolution (like DNS). It has no bearing on what IP addresses are affected to local interfaces. –  Mat Aug 2 '12 at 10:26
    
@Mat Well I carried on doing more research into this, and saw this to try: sudo #ifconfig hme0 10.0.11.10 netmask 255.0.0.0 up and it still didn't work. In fact it showed this error: ifconfig: could not create address: No such interface - Does that mean that the interface is wrong? What is the interface? –  Kevdog777 Aug 2 '12 at 10:29
1  
docs.oracle.com/cd/E19963-01/html/821-1458/fpcwh.html#scrolltoc - Solaris has extensive documentation, you should go ahead and browse the introductory parts. If you blindly type commands found on random blogs, you're likely to lock yourself out of your box at one point or another :-) –  Mat Aug 2 '12 at 12:31
    
Thank you @Mat. I have given up trying, both myself and my colleague and I have tried. So he suggested I try from scratch and redo the installation ... at least from there I can configure it properly. –  Kevdog777 Aug 2 '12 at 13:06
1  
@Mat docs.oracle.com/cd/E19963-01/html/821-1458/… rather –  Gilles Aug 2 '12 at 23:09
add comment

2 Answers

up vote 5 down vote accepted

According to the Solaris 11 network interfaces manual in chapter 8 “Configuring an IP Interface”:

ipadm create-addr -T static -a 10.0.11.10/24 eth0/staticip

eth0 is the name of the Ethernet interface (listed by ipadm show-if). staticip is a name that you can choose.

share|improve this answer
    
Thank you for the answer, but I have just tried this on the interface version (using Terminal) and I got this returned: ipadm: cannot create address: Persistent operation on temporary object - What does that mean? –  Kevdog777 Aug 6 '12 at 8:47
add comment

Assuming you are on Solaris 11:

I believe the above answer is too simplistic.

I've got a feeling that your current IP address is obtained via DHCP and now you want to switch to a fixed address ?

First you need to disable Network Automagic. (it will get in your way if all you want is a static IP address). Do it like this:

netadm enable -p ncp DefaultFixed

Next step is that you must explicitly create an IP interface. (because you've disabled network automagic). Do it like this:

ipadm create-ip net0

Now go ahead and assign a static IP address on that IP interface:

ipadm create-addr -T static -a 10.0.11.10/24 net0/v4

That's it. No need to reboot.

I don't know what netmask you want to use so the "/24" (equivalent of mask 255.255.255.0) is a guess. The "v4" means that you want to create an IPv4 address as opposed to a IPv6 address.

share|improve this answer
    
Thank you for this, but it is all sorted now. I used the GUI to do it all. But it looks like this would've worked too! –  Kevdog777 Aug 20 '12 at 14:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.