Solved

How to change IP address?

Posted on 2003-10-22
6
62,412 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 61

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 Schröder
ID: 9626807
which OS (Ultrix, BSD ...) ?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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 Schröder
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sync conflicts 1 26
Extending  a subnet 9 37
Resource cost of NAT vs routing 3 26
CCNA Data center exam questions 8 26
Let’s list some of the technologies that enable smooth teleworking. 
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

19 Experts available now in Live!

Get 1:1 Help Now