Solved

How to change IP address?

Posted on 2003-10-22
6
62,433 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Accepted Solution

by:
ppentchev earned 125 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 NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

688 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