new static ip address on ubuntu server

There are 3 replies in this Thread which was already clicked 354 times. The last Post () by mcmuzzy.

  • Hi, can anyone advise please.


    i am wishing to change the static ip address on my ubuntu server. (just changed to new internet provider)


    i log on using putty and the put in code.

    iface eth0 inet static


    but get the message command not found. i have read the tut in and tried the various codes to access the network interface with no luck.

  • If I have trouble in achieving this I allow my server to obtain an IP address from the router. I then log into the router and reserve this IP on the router for the mac address of my server. Works and never fails.

  • It is normally your router that will be assigned your public external IP address, not your actual server.

    Your server will then be assigned an internal / private IP address, probably something like 192.168.x.x something along those lines.

    So long as you have the necessary ports forwarded correctly from your router to your server you should be able to access your server via your new static IP address that has been provided by your new Internet Provider.


    The only situation that this MAY be different is if you have your server set up in the DMZ of your router as SOME routers will then directly assign your public / external IP address to whatever single device you have in the DMZ. But it is unlikely / unadvised that you operate in this way

  • Here try this


    ####MAKE STATIC IP ADDRESS####


    sudo nano /etc/network/interfaces


    and make it look like this choosing your own ip address extension


    example i am using 150


    change the dhcp to static and add these lines so it looks like this Using your configs as 0.1 is for wired and 1.1 is wireless i am using wired in this example



    auto eth0:0

    iface enp3s0 inet static

    address 192.168.0.150

    netmask 255.255.255.0

    broadcast 192.168.0.255

    network 192.168.0.0

    gateway 192.168.0.1

    dns-nameservers 8.8.8.8

    dns-nameservers 8.8.4.4


    Now to CTRL-X and then Y to save


    and to restart network with new ip type the following and press ENTER


    service networking restart or just reboot


    sudo reboot (hit enter)


    Hope this helps :-)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!