Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    520

    How do I setup a new ip address as my server's main ip address?

    I just bought a new ip address and want to setup this new ip as my server's main ip, making the 'existing main ip' as the secondary ip.

    Which means, this new ip will be the server's default ip address for all services, including when connecting to other server.

    I'm using CentOs 4.5 and swsoft's panels: HSPcomplete & Virtuozzo Power Panel, and Webmin.

    Thanks!
    |ーWe are all born to this world To meet a certain person; it must be soー|

  2. #2
    Join Date
    Jun 2003
    Location
    Janesville, Wi
    Posts
    1,520
    To change the IP configuration around, you need to first cd in "/etc/sysconfig/network-scripts".

    First, copy "ifcfg-eth0" to "ifcfg-eth0:1".

    You want your files to look like this:

    ifcfg-eth0 (using the new IP [and gateway if given a new one]):
    Code:
    DEVICE=eth0
    BOOTPROTO=static
    HWADDR=00:30:48:33:42:72
    ONBOOT=yes
    TYPE=Ethernet
    IPADDR=11.22.33.44
    NETMASK=255.255.255.0
    GATEWAY=11.22.33.1
    ifcfg-eth0:1 (using the old IP and old gateway):
    [code]
    Code:
    DEVICE=eth0:1
    BOOTPROTO=static
    ONBOOT=yes
    TYPE=Ethernet
    IPADDR=11.22.33.45
    NETMASK=255.255.255.0
    GATEWAY=11.22.33.1
    ifcfg-eth0 uses the new IP address/gateway provided to you. ifcfg-eth0:1 uses the old IP address/gateway.

    Make certain that everything is setup correctly, then run "service network restart". This may take a few seconds. Just wait.

    If it was done wrong, you may lose your connection to the server and require your provider to login via console and fix it.

    Also, if you've been given a new gateway IP address, be sure to update /etc/sysconfig/network with the new gateway IP.

    Finally, make certain to check the documentation for HSPcomplete and Virtuozzo for anything regarding new IP addresses.
    Jakiao

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •