[TUTORIAL NEWBIE] How to set static ip in Ubuntu

Discussion in 'Linux Ubuntu' started by fatpixellin, Dec 24, 2013.

  1. fatpixellin

    fatpixellin New Member

    Joined:
    Dec 5, 2013
    Messages:
    9
    Likes Received:
    0
    Hi, with this basic tutorial, i will show you, how set a static ip address in Ubuntu.

    To configure your Udoo board to use a static ip address assignment, we add the static method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces.

    Confirm your network interface name using below command,normally it’s eth0.
    Code:
    ifconfig -a
    Open network configuration file use below command.
    Code:
    sudo nano /etc/network/interfaces
    Remove the line (if have).
    Code:
    iface eth0 inet dhcp
    Append below lines.
    Code:
    iface eth0 inet static
    address 192.168.1.103
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
    Ctrl+O for save, then Ctrl+X for exit.
    Restart networking service to enable the change.
    Code:
    sudo /etc/init.d/networking restart
     
  2. Mu.Pathma

    Mu.Pathma New Member

    Joined:
    Jan 26, 2014
    Messages:
    3
    Likes Received:
    0
    Hi,

    I tried the above step when I am connected via WiFi, SSH.

    When I issue the restart command UDOO reply;

    ubuntu@udoo:~$ sudo /etc/init.d/networking restart
    * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
    * Reconfiguring network interfaces...

    I tried to do the same with root user, result the same, when I force restart the LAN is disconnected.

    Please advice

    Mu.Pathma
     
  3. lindsayhorner

    lindsayhorner New Member

    Joined:
    Mar 26, 2014
    Messages:
    4
    Likes Received:
    0
    I'm interested to hear how setting a static IP has been working out for other people, as I've been having real trouble. I've done it many times before on servers and Rasberry Pi's but for some reason on the Udoo it fails everytime, and I lose all connectivity.

    ifconfig -a tells me that my ethernet is 'eth6' which seems a little odd as I would have expected 'eth0'

    How has this worked for other people?
     
  4. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    The Ubuntu image uses eth6 , but the debian image uses eth0 , so it can`t be uboot setting it.
    I tried to fix that , but had so many other problem I just moved to Debain.
     
  5. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    Someone knows a solution that works ?
    It doesn't work for me and I really need it...
    I use a Neo Basic Board with Ubuntu
     
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,260
    Likes Received:
    564
    Masquime likes this.
  7. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    Thank you watervl, I found another way which works but your informations could be helpful
     
  8. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,260
    Likes Received:
    564
    What was that other way you used? That could also be helpful for the next one with this question.
     
  9. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    It's an empirical way, but it's works for me ( and I don't know why :)) :
    I followed this Raspberry pi tuto (which I'm familiar with) to found gateway address and network address (assuming I work with a box-router) :
    so I hit the following command :
    netstat -nr
    Which gave me
    gateway : 192.168.0.1
    network : 192.168.0.0 ( what is strange because my router address is 192.168.0.1, the same as gateway)
    And I put on the /etc/network/interfaces/ file :
    auto eth0
    iface eth0 inet static
    address 192.168.0.83
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1


    And I really don't know why, but...it works
     

Share This Page