How to change a host's IP address on the fly in solaris? *



  • View your current configuration:

    # ifconfig -a
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
            inet 127.0.0.1 netmask ff000000
    vmxnet0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
            inet 192.168.1.86 netmask ffffff00 broadcast 192.168.1.255
            ether 0:c:29:8f:dc:ce
    

    Change the IP address to .96 (instead of .86):

    # ifconfig vmxnet0 192.168.1.96 netmask 255.255.255.0 broadcast + up
    

    If you are not on the console, you will lose your ssh or telnet session and will need to log in with the new IP address:

    View your new configuration:

    # ifconfig -a
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
            inet 127.0.0.1 netmask ff000000
    vmxnet0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
            inet 192.168.1.96 netmask ffffff00 broadcast 192.168.1.255
            ether 0:c:29:8f:dc:ce
    

    The above procedure will not make the change persistent across reboots.


Log in to reply
 

© Lightnetics 2024