?
Solved

How to change IP address?

Posted on 2003-10-22
6
Medium Priority
?
62,436 Views
Last Modified: 2013-12-23
Hi All,

We have one 10 years' DEC Unix box (brand: Digital). Want to change its IP address. Besides looking the file in

/etc/resolv.conf
/etc/hosts
/etc/defaultrouter
/etc/netmasks

is there any file I need to take care?

Thanks!
0
Comment
Question by:terrywong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9604892
i do not know if they have something like
/etc/hostname.hme0, u have to check that too.

also i remember there used to be netsetup command on the  DEC, if u run it from there u can change the ip address from there and it will do the rest of the job for u.
0
 
LVL 62

Expert Comment

by:gheist
ID: 9610236
hostname.de0 is more likely to appear on DEC Alpha, hme is on SUN

Digital aka DEC was bought by Compaq, and network cards business by Intel
Now Compaq is slowly becoming HP with Alpha CPU business going to Intel

check out www.tru64unix.compaq.com for missing documents (it redirects to some HP site now)
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9626807
which OS (Ultrix, BSD ...) ?
0
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 

Accepted Solution

by:
ppentchev earned 500 total points
ID: 9682822
In my experience, one of the best ways to make sure you have *not* missed a file is to actually search for it: something like:
find -L /etc -type f -print0 | xargs -0 fgrep -l -e 192.168.0.1 -e 1.0.168.192

Note that you *do* need both of these: there are files (such as name server zonefiles) where the addresses are stored in the reverse, in-addr.arpa format, so make sure you find them too.  If the new address is not in the same subnet, or rather, if the difference is not just in the last octet, you'd better do a search for the starting octets, too:

find -L /etc -type f -print0 | xargs -0 fgrep -l -e 192.168.0 -e 0.168.192

In both commands, the '-l' is a lowercase ell, not an uppercase i.

If you are feeling really adventurous and you do not mind spending another couple of minutes in figuring out files to exclude and such, it would be best to run this search on more than just /etc: the whole / tree might be a bit too much, but if there are configuration files elsewhere (/usr/local/etc, /opt, /usr/share and so on), you might want to run a find/fgrep on those trees too.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9722031
grepping for 192.168.0 will find this string, too
   u192x168y0bla
which is NOT an IP address!

Use this instead:
  grep '192\.168\.0\.' `find /etc -type f`

I don't know which UNIX you had in mind, ppentchev, but the -L to find
is not very common, most "find"s don't support it.
0
 

Expert Comment

by:ppentchev
ID: 9722192
Errr... as far as escaping the dots, please note that I used 'fgrep', not 'grep'.  While it is true that 'grep' or 'egrep' would treat the dots as wildcard characters in the regular expression, the 'fgrep' tool will treat its argument as a fixed string, not a regexp, and will not attach any special meaning to the dot character.  A fgrep for 192.168.0 will *not* find u192x168y0bla :)

The use of grep ... `find ..` may be risky, if any of the files or directories should contain spaces in their names.  Consider the following:

[roam@straylight ~/tmp]> mkdir -p foo/a\ b/c
[roam@straylight ~/tmp]> touch foo/d foo/a\ b/c/e
[roam@straylight ~/tmp]> find foo -type f
foo/a b/c/e
foo/d
[roam@straylight ~/tmp]> ls `find foo -type f`
ls: b/c/e: No such file or directory
ls: foo/a: No such file or directory
foo/d
[roam@straylight ~/tmp]>

For this reason, the use of find/xargs is generally preferable, especially when using find -print0 | xargs -0, as in:

[roam@straylight ~/tmp]> find foo -type f -print0 | xargs -0 ls
foo/a b/c/e     foo/d
[roam@straylight ~/tmp]>

As to the -L option to find, you are right, I should have mentioned that there are some versions of find that do not have it.  It is commonly found on BSD-derived systems, and the reason I used it instead of 'find -type f' was to make sure that symbolic links are also searched.  Consider the case of, say, /etc/hosts being symlinked to /cfg/local/etc/hosts; a 'find /etc -type f' command would *not* "find" the /etc/hosts symbolic link, while it would definitely need attention by the original poster.  True, symlinking /etc/hosts is an extreme example, but there are many cases when there *are* indeed symlinks even within /etc.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

765 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