Advertisement: Linux VPS for $4/month - based on OpenVZ, credit card accepted, automatic setup.
+ Post New Thread
Results 1 to 2 of 2

Thread: How to change Linux dedicate server IP to another one from assigned subnet

  1. #1
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,429
    Post Thanks / Like
    Blog Entries
    1

    How to change Linux dedicate server IP to another one from assigned subnet



    Dedicated serve provider assigned two IPv4 subnets to the server and i wanted to use IP from second subnet as my server primary IP.

    1.2.3.192/27 Primary VLAN
    9.8.7.136/29 DDoS Protected
    I modified networking configuration like this:

    nano /etc/network/interfaces
    (centos /etc/sysconfig/network or /etc/sysconfig/network-scripts/ifcfg-*)

    commented out/removed lines beginning "address" and "gateway" because these contained IPs from first subnet which i did not wanted to use. And as "address" used third IP from the subnet of my choice. Example they assigned 9.8.7.136/29 subnet, so the third IP is 9.8.7.138 , the second IP is gateway. so i updated interfaces file that way. One can use also other IP, but not first two IPs of the subnet.

    vi /etc/hosts

    replaced IP too there. I also updated hostname there and in my server provider control panel set reverse DNS record for the new IP to match this hostname of my choice.
    Example line: 192.168.15.77 prox4m1.proxmox.com prox4m1 pvelocalhost

    then update also /etc/hostname

    service networking restart

    and from now on i was able to login my server via different IP i set above.

    If you have fix for this setup, please kindly share. Thank You

  2. #2
    Junior Member radwebhosting's Avatar
    Join Date
    Jan 2016
    Location
    Dallas, TX
    Posts
    21
    Post Thanks / Like


    Is this useful / helpfull? Yes | No
    Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 and ensure the IPs are properly bound to the NIC.
    RAD WEB HOSTING - Dallas, Texas Data Center - WHM Reseller Hosting
    Clearance Dedicated Servers - 500Gbps DDoS Protection - KVM VPS Hosting

+ Post New Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam