Solved

Ip address change

Posted on 2004-10-25
551 Views
Last Modified: 2013-12-27
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
0
Question by:bt74
    7 Comments
     
    LVL 34

    Expert Comment

    by:PsiCop
    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.
    0
     
    LVL 38

    Expert Comment

    by:wesly_chen
    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
    0
     
    LVL 10

    Expert Comment

    by:Nukfror
    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.
    0
     
    LVL 51

    Expert Comment

    by:ahoffmann
    you have to adapt /etc/inet/netmasks (and probably /etc/init.d/ip_aliases)
    0
     

    Expert Comment

    by: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
    0
     
    LVL 38

    Expert Comment

    by:wesly_chen
    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
    0
     

    Accepted Solution

    by:
    PAQed with no points refunded (of 50)

    modulo
    Community Support Moderator
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT Security CISA, CISSP & CISM Certification

    Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle. Built around industry best-practice guidelines, the IT Cyber Security bundle consists of three in-depth courses.

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    856 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

    16 Experts available now in Live!

    Get 1:1 Help Now