Solved

Sun Solaris 10 and IP Address Change

Posted on 2008-10-31
35
3,062 Views
Last Modified: 2013-12-27
Hello,
I was given a Sun Solaris 10 Blade server and it is fully functional on its own. Well, it seems that way. The problem is that the IP address for it is different than the range I am using . For example, this Sun server is using 192.168.0.1 and the subnet mask is 255.255.255.0. My IP range is within 192.168.1.x. The last two octets are different. My primarily network is Windows 2003 Server based and this is the only Unix box I have.

I've connected this box to my switch, but I cannot ping it from a workstation. I thought I would be able to ping it but no dice. From the Sun desktop, I cannot find anything that allows me to manage the network card or IP address. I need to change the ip address for this machine, and I might even have to rename it. I need to be careful, though. The email system called SunOne is installed on this machine, too.

I am looking for help on how to modify the IP address for this machine, and even rename the machine if I have to. Is there a GUI to do this? I cannot find one and I haven't a clue what Unix or Linux commands to use. I don't even know what commands to use just to see what the settings are or what the machine name is.

Thanks,
John
0
Comment
Question by:jhieb
  • 17
  • 16
  • +1
35 Comments
 
LVL 1

Author Comment

by:jhieb
ID: 22855050
PS: Just in case this matters, the machine is a Sunfire X2100
0
 
LVL 11

Accepted Solution

by:
jgiordano earned 500 total points
ID: 22855449
Ok so in a nutshell here is what you need to do and look for:

Hostname - in /etc/nodename
Ipaddress - in /etc/hosts (hostname and IP)
Subnet - in /etc/netmask
gateway - in /etc/defaultrouter
***Nic card ID and IP Bind - You will need to look for a file in /etc/<CURRENT HOST NAME>.<network interface> and place the hostname in this file. This file looks to /etc/hosts and resolves it's hostname with the ip.


0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22855488
Basically there are 2 ways to do this the 1st step needs to be done regardless, just in case the system reboots, the second can be done if you can't reboot right away and need to change the network. I recommend doing one and rebooting so you are sure the network comes up correctly after a reboot.

1) change the ip in /etc/hosts
2) change the nodename in /etc/nodename
3) change the netmask in /etc/netmask
4) change the default gateway in /etc/defaultrouter
5a) do an ifconfig -a (this will tell you what type of nic you have (it will be on the left side and be bge0, eri0, qfe0, e1000g0 or something similar)
5b) look for this extension on a <CURRENT HOSTNAME>.<NIC> in /etc/ and remove it. Add a new file with the <NEW HOST NAME>.<NIC> and inside add the new hostname.


Live system that can't be rebooted -
1) Change the files above
2) ifconfig <NIC> down
3) ifconfig <NIC> inet <NEW IPDRESS> netmask <NEWSUBNET> broadcast <192.168.X.255>
4) ifconfig <NIC> up
5) netstat -rn (if the default gateway is different you will need to delete the route)
5a) route delete default <IP OF OLD GATEWAY>
5b) route add default <IP OF NEW GATEWAY>
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22855502
Keep in mind you don't have to change the hostname if you don't need to.

Also there is a sys-unconfig  utility that will restore a machine to a clean unidentified state - /usr/sbin/sys-unconfig
http://docs.sun.com/app/docs/doc/802-1930-1M/6i5u98eaf?a=view

It cleans it out a little bit more and also affects user information which may be a problem on configured systems.
0
 
LVL 22

Expert Comment

by:blu
ID: 22856538
If you are just setting up a new installation, or just setting up an old installation obtained from a different owner, the recommended method is to use the sys-unconfig utility mentioned above. It sets asks you a few questions that are often network and owner specific and then sets them correctly on
the system. Things like IP address, hostname, naming service setup.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22858006
Hi Everyone, I just wanted to touch bases with you so that you didn't think I was ignoring these posts. Currently, I am away for the weekend but I might have time to look at this sometime this weekend (I am still in the local area). Thank you for taking time to respond to my question. I do have a little more insight that I wanted to tell you about. First, I am a newbie when it comes to Unix. If this were Windows I would not be asking these questions and usually tout myself as actually knowing what I am doing.

In the examples given above, where I am instructed to change some files, I am not sure how to change them. That's a newbie question isn't it? Do I do this in the Terminal program, and if so, what command do I use to change those files e.g. how do I invoke the editor to change those files.

Thanks,
John
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22858244
Do you know which gui you are using? CDE or gnome
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22858249
you can use vi a terminal editor but it can be a little difficult.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22858543
I didn't install the server software so I don't know all of the details. But, all I can see is that this looks like a very basic installation. There doesn't seem to be an editor but there is Terminal. Is installing an editor that hard to do? I'll try terminal if I have to.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22858554
The easiest way is using the terminal. Out of the methods above which way sounds like it would work better? Are there user accounts and other info that should be saved or should we treat it as a clean install?
0
 
LVL 1

Author Comment

by:jhieb
ID: 22858564
It is probably closer to a clean install than anything else as it was never put into production. The person who installed the Sun Solaris system used a Null Modem Cable to connect to it via another workstation. There are just three accounts on it, and the server is running SunOne, which is the email system. Hopefully, the changes I make don't make SunOne inoperable. But if it does I am sure there is a way to make it work again.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22859148
if you are ok with the risks then feel free and run the sys-unconfig utility. I am not familiar with sun one so I don't know the hooks into the os. There is less of a chance of mistakes with the utility.
0
 
LVL 3

Expert Comment

by:Saranyakkali
ID: 22867216
Please remember one thing bit small changes in solaris 10:

/etc/inet/ipnodes
/etc/inet/hosts
and rest of same..

1) change the ip in /etc/hosts
2) change the nodename in /etc/nodename
3) change the netmask in /etc/netmask
4) change the default gateway in /etc/defaultrouter
5a) do an ifconfig -a (this will tell you what type of nic you have (it will be on the left side and be bge0, eri0, qfe0, e1000g0 or something similar)
5b) look for this extension on a <CURRENT HOSTNAME>.<NIC> in /etc/ and remove it. Add a new file with the <NEW HOST NAME>.<NIC> and inside add the new hostname.


Live system that can't be rebooted -
1) Change the files above
2) ifconfig <NIC> down
3) ifconfig <NIC> inet <NEW IPDRESS> netmask <NEWSUBNET> broadcast <192.168.X.255>
4) ifconfig <NIC> up
5) netstat -rn (if the default gateway is different you will need to delete the route)
5a) route delete default <IP OF OLD GATEWAY>
5b) route add default <IP OF NEW GATEWAY>

Please let me know if you need any more help on this...

Thanks
0
 
LVL 1

Author Comment

by:jhieb
ID: 22871154
Thanks everyone. It is hectic right now and I will have some focus time to tackle this (or destroy my system) on Wednesday of this week. I will keep you posted.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22889908
Hello, I am working on this today and have edited my hosts file to the new IP address. I left the Nodename the same, which is solaris. Does it need to change? I changed the netmask. I am curious why the netmask needs to end with a .0. Do I need to put in the full IP address under the netmask or is it supposed to end with .0?

I cannot find a file called defaultrouter. It is neither in the etc/default folder or in the etc folder. Why would this be missing?

I did not remove the hostname.nic since I did not change the hostname. I am cautious about doing this just yet. Is this important to do if I do not change the nodename?

Thanks,
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890002
/etc/defaultrouter should exist, not sure why it is not there

can you do a netstat -rn
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890125

I will keep looking... I could be blind but I cannot see that file. Here are the results from netstat -rn

Destination     Gateway          Flags     Ref     use     interface
192.168.1.0     192.168.1.30     U           1         1           nge0
224.0.0.0         192.168.1.20     U           1         0           nge0
127.0.0.1          127.0.0.1          UH         32       219       lo0

If I am reading this correctly, it wants the ip address to my gateway (which is my router, correct?). My router is 192.168.1.1.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 11

Expert Comment

by:jgiordano
ID: 22890182
you don't have a default route so it might not exist.

do:

ls -ltr /etc/defaultrouter

if you get nothing back you don't have the file and need to create one.


if you need to add your gateway manually

route add default <gateway>
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890223
OK, I haven't run the route add default <gateway> command yet because I would like to add the defaultrouter file, instead. This is the best approach, isn't it? What is the syntax for the defaultrouter text file? Should I just create a text file and add the routher IP address to the first line?
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890253
yes regarding the syntax


the defaultrouter file will only be read on reboot. If you are not rebooting you will need to issue the route add.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890375
I created a defaultrouter file and added my router/gateway ip address of 192.168.1.1. Then, I rebooted the system and ran the netstat -rn command. My results are:

Destination     Gateway          Flags     Ref     use     interface
192.168.1.0     192.168.1.30     U           1         1           nge0
224.0.0.0         192.168.1.20     U           1         0           nge0
127.0.0.1          127.0.0.1          UH         32       219       lo0
default            192.168.1.1        UG        1        0

Do you think I should have added other items/settings to my defaultrouter file? I don't think it is working (I cannot get to the internet). It might be that it doesn't know what interface to use.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890415
If I change the nodename for my system will I have to change anything else? Currently, this system is just called "solaris" and I might want to change that if it doesn't mess with anything else. This server is a test email server and since I am so very unfamiliar with what I am doing I do not want to put myself in hot water by breaking it. At least, for now, I can get to the test email with the address I need to use.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890416
can you ping the default router?

if not do a ifconfig -a and list the results
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890429
Yes, when I ping 192.168.1.1 from the Sun system it tells me that it is alive.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890455
then do you have anything on another vlan that you can ping?

One file that I don't see listed up top is the /etc/resolv.conf this is where the dns servers are stored, please place your dns servers here.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890467
I don't have a virtual lan, but this system is on my lan. I can ping my router from another workstation if that is what you mean. I will list the contents of the /etc/resolv.conf file for you in must a moment.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890502
You are right. That file is not there. I looked for /etc/resolv.conf and could not find it with the text editor. So, i used the command you previously gave me e.g. ls -ltr /etc/resolv.conf and no such file exists.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890536
the resolv.conf should look like this (obviously replace your domain and dns servers)


# domain ampr.org
nameserver 204.xxx.yyy.1
nameserver 204.xxx.yyy.2
nameserver 204.xxx.zzz.1


also issue and post the output from
grep hosts /etc/nsswitch.conf
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890641
Thanks. I need to clarify the content for the resolve.conf. You have a # in front of your domain so I assume that this is a comment. Therefore, this line is for my information only, correct? Hopefully so. If not, then I need clarification on what to put into the domain line. The reason being is that the sun system has it's own domain, and it is part of a Windows domain. So, which domain should I use if this line is important?

The nameserver line just wants to know which server maintains dns, is this correct? If so, then if my dns server is 192.168.1.5 then all i have to enter is: nameserver 192.168.1.5 as one line in the resolv.conf file.

The nsswitch.conf file has a lot of stuff inside of it, and it looks like the content is what came out of the box. In other words, I doesn't appear that anything in it has been set. When I run the grep command, I get the following response:

"hosts:" and "services:" in this file are used only if the hosts:        Files

That's all grep returns. What it shows appears to be a comment line (A line beginning with #). It is too bad I cannot get to the internet on the Sun computer. I would gladly copy and paste the entire results for you. Right now, I have to use old fashed paper and pencil. I almsot forgot how to do that...
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890731
no comment in front of domain

your domain should be the domain your sun box is on.

yes on the nameserver


lastly your nsswitch.conf should look something like
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

passwd:     files
group:      files
hosts:      files dns
ipnodes:    files
networks:   files
protocols:  files
rpc:        files
ethers:     files
netmasks:   files
bootparams: files
publickey:  files


add a line or edit your nsswitch.conf =

hosts:      dns files

0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22890744
nsswitch has a lot more but I just copied a subset
0
 
LVL 1

Author Comment

by:jhieb
ID: 22890891
If I understand you correctly, I am to edit the line and add the domain my sun box is in. The domain my sun box is in is a windows domain and it is also <domain>.local. So, I entered this domain inside the /etc/nsswitch.conf file.

Now, I am not too sure what to do about the nsswitch.conf file. The contents do look like what you pasted (with a bunch of other similar stuff). What exactly do you want me to do by your statement:

add a line or edit your nsswitch.conf =

hosts:      dns files




0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22891042
I think you mistyped on the first one it should be resolv.conf


on the nsswitch.conf

see if you have a line

hosts: files

and change it to

hosts:   files dns


this tells the networking to look locally @ the hosts file for name resolution and then query dns. If we just left it files it would not look at dns.
0
 
LVL 1

Author Comment

by:jhieb
ID: 22891118
Egads! I am typing this from my Sun box. Changing that hosts statement to files dns got me online. Cool. I think we got this working... I am probably forgetting something and would like to pick your brain some more but I think you've thoroughly and completely answered my question. Thank you very much for your help.
0
 
LVL 1

Author Closing Comment

by:jhieb
ID: 31512242
Thanks for sticking around and walking me through this. I really appreciate it.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now