[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to change IP address?

Posted on 2003-10-22
6
Medium Priority
?
62,452 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
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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article explains the fundamentals of industrial networking which ultimately is the backbone network which is providing communications for process devices like robots and other not so interesting stuff.
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
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.…

830 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