Link to home
Start Free TrialLog in
Avatar of bt74
bt74

asked on

Ip address change

Hi

I am having a Solaris box 2.5.1 and i need to change the ip address.

i have done it by ifconfig command.

ifconfig le0 inet 111.111.0.2 netmask 255.255.255.224 broadcast 111.111.0.31

also i made changes in the following files also.

/etc/hosts

111.111.0.2 hostname

/etc/netmasks

111.111.0.0  255.255.255.224

also i have the gateway entry.

route add default 111.111.0.1 1

---------------------------------------------------

the pblm is when am rebooting my server, my broadcast address is not setting properly. due to this from some of my local networks, they r unable to reach my server....
after rebooting my broadcast addrees is setting to 111.255.255.255 instted of 111.111.0.31
where is the pblm..???
my mask is showing ff000000 ( is this equals to == 255.255.255.224 )
this is my interface output.
 
$ ifconfig le0
le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 111.111.0.2 netmask ff000000 broadcast 111.255.255.255

i need the output like this..

le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 111.111.0.2 netmask 255.255.255.224 broadcast 111.111.0.31


where am making the mistakes..???

regards
Avatar of PsiCop
PsiCop
Flag of United States of America image

You need to change /etc/hostname.le0

You should put the "hostname" in that file (I'm assuming the hostname also changed).

You can also try using the sys-unconfig script.
Hi,

    ff000000 is 255.0.0.0, not 255.255.255.224. It is standard Class A netmask.

   As my experience, Solaris 2.5.1 (which is not supported by Sun anymore) has problem to set the netmask which is not standard Class A, B, C. In other words, /etc/netmasks might not work for 255.255.255.224.

   Since your IP address 111.*.*.* is in the Class A range, so your netmask is set to 255.0.0.0.

   The other workaround is adding one line in /etc/rc2
"ifconfig le0 down; ifconfig le0 111.111.0.2 netmask 255.255.255.224 up"

PsiCop, the question is "change IP", not hostname. Besides, there are 6 files need to be changed for hostname change for Solaris.

Regards,

Wesly
From what I remember about older Solaris revs, you had to be pretty verbose in /etc/netmasks.  So something like this:

111.0.0.0  255.255.255.0
111.111.0.0 255.255.255.224

I can't remember exactly but you have to put more in /etc/netmasks then what you would think you would really need to.
you have to adapt /etc/inet/netmasks (and probably /etc/init.d/ip_aliases)
Avatar of RayZilla
RayZilla

The best way to deal with this is :

at the root prompt # type sys-unconfig

this will allow you to reconfigure all network settings in a question / answer fashion.

Don't be scared about the warning though ( Below) it only refers to the network settings beeing cleared to
allow you to change them.

"This program will unconfigure your system. It will cause it
to revert to a "blank" system - it will not have a name or know
about other systems or networks "



Regards

Ray
Hi,

> ifconfig le0 inet 111.111.0.2 netmask 255.255.255.224 broadcast 111.111.0.31
How about put
---------
/etc/hosts
111.111.0.34  hostname

/etc/netmasks
111.111.0.32    255.255.255.224
-------
Back to my CCNA study material, for variable length subnet, the first and the last subnet are not the valid subnet.
So 111.111.0.1 to 111.111.0.31 are not valid.

Wesly
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial