problem with static ip on ubuntu server

There are 21 replies in this Thread which was already clicked 1,148 times. The last Post () by jason666.

  • Hi guys,


    I would like to have a static ip on my ubuntu server. Tried severall things but with no success.
    If changed the following /etc/network/interfaces


    auto eth0
    iface eth0 inet static
    address 192.168.1.90
    netmask 255.255.255.0
    gateway 192.168.1.1


    If i restart the pc an i check with: ifconfig, i see the pc has ip 192.168.1.90 assigned, but internet is not working!!!!!


    When i have eth0 set to DHCP, internet is working 100%.


    What am i doing wrong....??

  • i still have problems if i follow the link above.
    I still do not get the ip assigned that i have put in.


    This is with static ip: (working 100%!!!!!!!!!)
    eth0 Link encap:Ethernet HWaddr 00:1c:23:27:56:06
    inet addr:192.168.1.71 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::21c:23ff:fe27:5606/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:17555 errors:0 dropped:0 overruns:0 frame:0
    TX packets:16700 errors:0 dropped:0 overruns:0 carrier:0
    collisions:2253 txqueuelen:1000
    RX bytes:7798327 (7.7 MB) TX bytes:2927719 (2.9 MB)
    Interrupt:17



    If i do:
    sudo gedit /etc/network/interfaces
    i get the following:
    auto lo
    iface lo inet loopback


    auto eth0
    iface eth0 inet dhcp


    I change it to the following:
    auto lo
    iface lo inet loopback


    auto eth0
    iface eth0 inet static
    address 192.168.1.87 (example)
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1


    I save this and do the following in terminal:
    sudo /etc/init.d/networking restart


    I get the foillowing message:
    * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
    * Reconfiguring network interfaces... RTNETLINK answers: File exists
    Failed to bring up eth0.


    Even if i reboot manually i does not work.



    What am i doing wrong???
    I am also not sure of my network ip link 192.168.1.0?????? Where do i check this?
    Also my gateway i am not sure. If i do ipconfig om my windows pc the standard gateway is 192.168.1.1. So i suppose it's this the one.


    Hope someone can help.


    Thanks

  • i notice if i peform in terminal "sudo ifdown eth0", and afterwards "sudo /etc/init.d/networking restart", the internet is working!!!!! BUTTTT, if i restart the server, my internet is down again.
    If i do "sudo gedit /etc/resolv/conf", there is no nameserver. Default it was 192.168.1.1

  • i notice if i peform in terminal "sudo ifdown eth0", and afterwards "sudo /etc/init.d/networking restart", the internet is working!!!!! BUTTTT, if i restart the server, my internet is down again.
    If i do "sudo gedit /etc/resolv/conf", there is no nameserver. Default it was 192.168.1.1


    Are you using an virtual machine ?

  • i am using a laptop with ubuntu 12.04 lts.
    I will try the advice from herr flick and will let you guys know.
    Do you mean this?
    address 192.168.1.87 (example)
    broadcast 192.168.1.87

  • Connect a windows laptop to your router and go start then in in the command line type ipconfig /all
    That should give you all the settings you need m8
    IE: for VM
    auto eth0
    iface eth0 inet static
    address 192.168.0.?
    netmask 255.255.255.0
    broadcast 192.168.4.100
    gateway 192.168.0.1


    For $ly
    auto eth0
    iface eth0 inet static
    address 192.168.0.?
    netmask 255.255.255.0
    broadcast 192.168.0.1
    gateway 192.168.0.1

  • I have tried you guys advice but with no success.
    option 1: i have used the same address and broadcast ip (ex. 192.168.1.89)
    The pc restarts without any problem, but my internet is not working.


    option 2: i have used the same broadcast and gateway ip address (192.168.1.1).
    The pc does not startup correct. I metions a network issue: waiting for 60 more seconds to configure the network....
    No internet of course


    Any more ideas???

Participate now!

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