Solaris Networking Script

Hi everyone,
I am charged with changing the ip addresses on 49 servers.
Please is there a way i can automate this process via a script?
If possible how do i go about it.
Thanks

Well, you probably can, but that doesn't mean you should :) At least not if you are thinking of running the script from one host in order to change the IP of all the remote host, for one thing the script would stop executing once you change its address, and if you make a mistake in your script you would then end up making a lot of hosts inaccessible.
There are two things you have to do, change the configuration on disk and change the running configuration, the configuration on the disk is normally edited by changing the files:
/etc/hostname.<interface>
/etc/hosts
/etc/defaultrouter
/etc/netmasks
and sometimes:
/etc/inet/ipnodes
To change the running configuration you would use ifconfig and route (if you have to change the default router).
One method here could be to change the configuration files and then reboot, just to be certain that the configuration on the disk is correct.
You could also write a script which changes both the running configuration and the files, but i would suggest that you run the script locally from the console.
.7/M.

Similar Messages

  • How to create multiple users in solaris using script

    hi
    how i can create multiple users (2000 users) using shell script with a common password .
    useradd is creating one user at a time.
    thanks

    I m new to solaris and scripting also.
    how i can write a script for this .

  • Network script stoped working

    My Network script (the one in /etc/rc.d/network stopped working but manually using the if/iw config tools works.
    $ sudo /etc/rc.d/network start
    :: Starting Network [BUSY]
    > Could not associate wlan0 - try increasing WIRELESS_TIMEOUT and check network is WEP or has no security
    SIOCADDRT: No such process
    rc.conf
    eth0="dhcp"
    eth1="dhcp"
    wlan0="dhcp"
    wlan_wlan0="wlan0 essid dd-wrt" # Unencrypted
    INTERFACES=(!eth0 !eth1 wlan0)
    gateway="default gw 192.168.1.1"
    ROUTES=(gateway)
    manually
    $ sudo ifconfig wlan0 up
    $ sudo iwconfig wlan0 essid dd-wrt
    $ sudo dhcpcd wlan0
    dhcpcd: version 5.1.3 starting
    dhcpcd: wlan0: broadcasting for a lease
    dhcpcd: wlan0: offered 192.168.1.109 from 192.168.1.1
    dhcpcd: wlan0: acknowledged 192.168.1.109 from 192.168.1.1
    dhcpcd: wlan0: checking for 192.168.1.109
    dhcpcd: wlan0: leased 192.168.1.109 for 86400 seconds
    dhcpcd: forking to background

    And what happens if you do increase the value of "WIRELESS_TIMEOUT" ?
    You can add this variable to your rc.conf file (with something like "WIRELESS_TIMEOUT=4") or by editing /etc/rc.d/network.
    EDIT: alternatively, you could put this value in the /etc/conf.d/wireless file, which might be "cleaner".
    Last edited by hexanol (2009-11-29 14:27:18)

  • Persistent Network script?

    One of the issues that most Linux distros, including Arch, have is that during the boot process, there is only one dhcp lease request issued from the init scripts. This poses a problem when:
    - The user boots the computer and the router at the same time. As the router needs some time to initialize, when Arch boots and runs the network script, the dhcp lease request from the network script does not arrive at the router, because the router is still busy initializing, hence the network script fails, and there is no network connection.
    I can imagine that the network connection also gets lost when:
    - A subsequent dhcp lease request gets lost. Dhcp lease is not sustained.
    - IP address collisions. Network communication is disrupted.
    - Router goes offline and back upline and requires that all clients re-request a dhcp lease.
    I have not investigated these cases, maybe someone can comfirm this?
    Anywayz, in all these cases, a dhcp lease re-request fixes the problem, alas, this does not happen in the current situation.
    The network script should persistently try to gain a dhcp lease, when there is no dhcp lease received as of yet, to prevent this behaviour. This is the case in Windows.
    Maybe there is a common solution to this problem already?
    Yes, I am aware of the fact that root can login and run '/etc/rc.d/network restart' to (re-)establish the network connection, but it's a hassle and root intervention should not be needed.
    EDIT: This could be a dhcpcd issue.
    Last edited by OutOfPhase (2007-04-21 18:04:09)

    don't reinvent the wheel: use ifplugd.
    ifplugd waits for link events/link status from the network card, and takes action accordingly.
    configure eth* in rc.conf, do not start them, and add ifplugd to daemons. all your problems vanish at once. I even use it for wireless, and this gives me a totally event driven, minimal, layered, async configuration for maximal ease of use:
    /etc/rc.conf
    lo="lo 127.0.0.1"
    eth0="dhcp"
    wlan0="dhcp"
    INTERFACES=(lo)
    daemons=( ... ifplugd wpa_supplicant ...)
    /etc/ifplugd/ifplugd.conf
    NET_IFS="eth0 wlan0"
    ARGS="-fwI -u0 -d10"
    ARGS_wlan0="-MwI -u5 -d5"
    I won't detail the wpa_supplicant daemon script, as it's not relevant to your situation.
    I always wondered why people bothered with baroque sequential (start A, an if it succeeded start b else do that and... etc...) solutions (like in gentoo, see the size of their net scripts!) when such layered async solutions are both easy, stable, and hassle-free (even supports roaming OOTB)
    Last edited by lloeki (2007-04-21 19:56:11)

  • Solaris Networking - The Magic Revealed

    Just in case you missed this...
    Sunay has been in India for the past few weeks and has actually been working! He's just finished the treatise on Solaris Networking which will become a new section of the Solaris Internals book.
    In his blog, Sunay has included excerpts to give us a preview of what's to come!
    Check out his blog entry: Solaris Networking - The Magic Revealed at:
    http://blogs.sun.com/sunay
    Best,
    - Carol

    Hello.
    I was porting another network driver to Solaris and I used GLD, too.
    I do not know which GLD version I was using. (I think not v3; module name is /kernel/misc/gld, not /kernel/misc/mac.)
    The documentation I used was "Writing Device Drivers" in the "Solaris 10" section on Sun's documentation site.
    All include files were present on Solaris 9/Sparc and OpenSolaris/x86 (I do not have Solaris 10 installed so I cannot tell you if the include files are present.)
    Martin

  • [Beginner Oracle 10g on Solaris 10]Script Root.sh asking road

    Hello,
    Need help please, Iam near the end of my installation Oracle 10g on Solaris 10, Oracle installer ask me to execute Root.sh, he ask me a path, suggesting me this road /usr/local/bin
    The message is Enter the full pathname of the local bin directory : usr/local/bin/ ?
    my path is
    $PATH=/usr/bin:/usr/dt/bin:/usr/openwin/bin/:usr/ucb
    $ORACLE_HOME=/export/home/oracle/oraInventory.
    This message follow after I executed orainstRoot.sh successfully.
    Thx for any help.
    Edited by: user583169 on Feb 24, 2009 1:41 PM

    This script asks for path where oraenv, coraenv and dbhome scripts should be copied/created.
    Default (suggested) path (full path to directory) is /usr/local/bin directory but you can specify your own directory.
    So you have at least two options:
    1. Use default location and put /usr/local/bin to your $PATH environment variable
    2. You can specify your own path which exists (is set) in $PATH variable (for example /usr/bin)

  • SQL*Loader-523 error in solaris sh script

    I have a SQLLdr script that I want to call from a unix shell (sh) script. We are running on Solaris 8. When we run from the command line the Sqlldr works, when we run from within a shell script, we are getting an STD ERR -2 error. I have tried running SQLldr with the -s (silent option) and silent = all but it doesn't seem to be helping.
    I pasted the error that I am getting below.
    Thanks,
    Greg
    SQL*Loader: Release 8.1.5.0.0 - Production on Wed Jul 19 15:20:48 2000
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    SQL*Loader-523: error -2 writing to file (STDERR)

    ...Ugh, it was working for about 5 seconds on my test page, but now it's just giving me an exit status of 137(Anyone have any clue what this means? I can't find anything that tells me what these exit number means and it's really starting to bug me) after I commented and uncommented a few lines to check to see what caused it to work...Hah! Works again. New Question time:
    LD_PRELOAD, what does this variable have to do with SQL*Loader, since I'm using it in the apache start-up to do some stuff with oci8[No idea if it's necessary] and when I, assumedly, set it to "null" it works, but when it keeps my initial value it breaks and gives me my 137 error status with my original errors.

  • Solaris 10 scripts in /etc/rc2.d at boot time

    On Solaris 8, boot our scripts in /etc/rc2.d displayed echo to the console
    and allowed "read" from the console. In Solaris 10, the input/output
    from our scripts goes to msglog. How can I get these scripts to
    send output and receive input to the console. (This occurs before the CDE GUI console starts)

    Hi
    Inside the script you forward the output to /dev/console..Check whether > /dev/console is present in the script or not.
    Regards

  • Configure Solaris network on vmware

    Hi all
    I've installed solaris on vmware and now want to configure the network so that I can ping the solaris OS from outside vm (or from the different vm)
    Could you please let me know the steps of configurations?
    Thanks in advance

    Please provide the name of the network adapter on your solaris vm?
    Run dladm show-dev , this will show all network adapters.
    If you dont see any then within vmware add a network adapter on the right network to the VM then reboot the VM and run that command again.
    Then just let me know and ill proceed with next steps.

  • Solaris Network Configuration

    Hi,
    In solaris7 I am able to connect server from local network.
    But from external network, I could not.
    Where should I configure the server to allow connections from external >networks.
    Thankful to you.

    Hi,
    When you say not able to connect, generally it means ping is not working. This could be due to many reasons. Like:
    1. Firewall or router access list setup at your place.
    2. If there is no firewall, server does'nt know how to route packets to external network. In that case you need to define default route in routing table. ( /etc/defaultrouter ).
    If you need to discuss it further, please mention your e-mail address, I would contact you for resolving this problem.
    Thanks
    Kalpesh

  • BUG in Solaris startup scripts

    If you try to define either "PRE_CLASSPATH" or "POST_CLASSPATH" in startWebLogic.sh or startPetStor.sh, the script concatenates them with the undefined variable "WEBLOGICCLASSPATH", effectively nulling out the BEA part of the CLASSPATH.
    So WebLogic doesn't start as the main classes are not in the path.
    Workaround:
    Replace "WEBLOGICCLASSPATH" with "CLASSPATH".

    Thanks Rafi,
    This has already been fixed in the next release.
    Jim Rivera
    "Rafi Jacoby" <[email protected]> wrote in message
    news:3a0c6cd9$[email protected]..
    >
    If you try to define either "PRE_CLASSPATH" or "POST_CLASSPATH" instartWebLogic.sh or startPetStor.sh, the script concatenates them with the
    undefined variable "WEBLOGICCLASSPATH", effectively nulling out the BEA part
    of the CLASSPATH.
    So WebLogic doesn't start as the main classes are not in the path.
    Workaround:
    Replace "WEBLOGICCLASSPATH" with "CLASSPATH".

  • Solaris network boot - a20 enable failed

    i am trying to install solaris 10 x64 on a HP proliant blade HP bl45p.
    It only supports PXE boot and for that i have setup a PXE server that assigns a DHCP address to my blade. The blade gets the IP and start to net boot but fails giving error
    A20 enable failed
    <hangs here>
    looks like there is a patch to solve this problem butnot sure how to put that patch to my cd image on the PXE server.
    any views on this??

    Which version of Solaris x86 are you installing? This isn't the GRUB based
    S10 1/2006 release, correct?
    I guess that HP proliant blade HP bl45p doesn't have a PS/2 keyboard controller
    any more (legacy free pc), and fails for a similar reason that GRUB doesn't start
    on Intel iMacs: the boot code tries to use the non-existant keyboard controller to
    toggle the gate A20, and fails:
    http://www.opensolaris.org/jive/message.jspa?messageID=31818#31818
    OTOH, I do see a bug report filed against the old boostrap loader boot.bin
    http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6230381
    and this appears to be fixed in S10 1/2006 . If you haven't tried S10 1/2006...
    it might work better on this HP blade hardware.
    BTW, you probably have to use a serial console, otherwise it will hang once
    again in multiboot, when no i8042 ps/2 keyboard controller is present:
    http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6412226

  • Solaris shell scripting

    #!/bin/sh
    clear
    echo
    #the script tests the if and then loop
    echo "is it morning please answer yes or no"
    read timeofday
    if [ $timeofday="yes" ]
    then
    echo "gud mrng"
    else
    echo "gud afternoon"
    fi
    exit 0
    I am facing problem in the execution of this script.
    It always gives the output "gud mrng"
    Please solve it and reply

    Fixed:
    #!/bin/sh
    clear
    echo
    #the script tests the if and then loop
    echo "is it morning please answer yes or no"
    read timeofday
    if [[ $timeofday = "yes" ]]
    then
      echo "Good Morning"
    else
      echo "Good Afternoon"
    fi
    exit 0The results are as follows:
    ./morning.ksh
    is it morning please answer yes or no
    yes
    Good Morning
    ./morning.ksh
    is it morning please answer yes or no
    no
    Good Afternoon

  • Wireless and network script restart

    Hi,
    I have the following problem. I'm using net-auto for autoloading wi-fi netprofile at boot time. When the profile fails to load, it won't load even when doing /etc/rc.d/net-auto restart, neither when I use netcfg -a and starting the profile manually. The only thing visible is that association failed. Any ideas where to look for problems any further? Thanks
    Tomas

    I had this problem solved installing Quirks as explained on the wiki
    http://wiki.archlinux.org/index.php/Net … d_later.29
    For me, as I use madwifi, I added
    QUIRKS=(prescan predown)
    as I use madwifi and essid is hidden.

  • /etc/rc.d/network: bash script: how to find out, if there was an error

    hello!
    i want to write a bash script for my wireless lan. for this i need the information, if the network daemon has connected successfully or failed.
    but there is a big problem: starting network success' every time, whether there was an error or not:
    $ /etc/rc.d/network start
    :: Starting network profile: 00wlan_home [BUSY]
    Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; No such device.
    [FAIL]
    :: Starting Network [DONE]
    $ ls /var/run/daemons/
    ... network ...
    can someone help me please? how can i realize  that "::Starting Network ..." also fails and the script returns an exit status 1?
    thanks for your help, maybe we can improve the script. but i'm not a geek in bash!
    mfg iggy

    iggy wrote:
    hello!
    i want to write a bash script for my wireless lan. for this i need the information, if the network daemon has connected successfully or failed.
    but there is a big problem: starting network success' every time, whether there was an error or not:
    $ /etc/rc.d/network start
    :: Starting network profile: 00wlan_home [BUSY]
    Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; No such device.
    [FAIL]
    :: Starting Network [DONE]
    $ ls /var/run/daemons/
    ... network ...
    can someone help me please? how can i realize  that "::Starting Network ..." also fails and the script returns an exit status 1?
    thanks for your help, maybe we can improve the script. but i'm not a geek in bash!
    mfg iggy
    try using netcfg to start the wireless profile, that should keep you happy until the new network scripts are unleashed... which won't have this problem.
    James

Maybe you are looking for

  • Qosmio G30-176: TV tunner issue - blurred without any sounds

    I from the seychelles and we use a Pal System similar to that in the UK, but I cannot tune the TV Tuner. It always comes out blurred without any sounds. Can somebody please help?

  • Migrate MS SQL Server procedure to Oracle

    Can any one suggest me any user friendly tool to Migrate MS SQL Server procedure to Oracle. I think using OMWB we can migrate schemas, as i could not find any interface to migrate a single procedure

  • Address book widget stuck

    Quite often after doing a search using address book widget the next search won't work - I cannot type anything in the search field and I get the keyboard bleep as if I am doing something wrong. Anyone know what's going on? Cheers! Phil

  • I have forgotten my password to my Account, not my ID, how do I retreive it?

    I have forgotten my password to my Account, not my ID, how do I retreive it?

  • Why my podcast aren't into iTunes ?

    Hello, I have made too feed for a podcast, one for the english version and one for the french version. My feed with the english podcast was validated by Apple and i found it into iTunes but the french feed is not validated by Apple without explicatio