PINE64
possible to set a static IP using uEnv.txt? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6)
+---- Forum: Ubuntu (https://forum.pine64.org/forumdisplay.php?fid=27)
+---- Thread: possible to set a static IP using uEnv.txt? (/showthread.php?tid=770)



possible to set a static IP using uEnv.txt? - cplr - 04-25-2016

Hi everyone,

I tried googling this, but came across a lot of different information that doesn't seem to work for me.

I'm interested if there's a way to use uEnv.txt to set up a static/manual IP? ideally i'd like to configure ip, gateway, subnet and hostname. The reason I want to do this in uEnv.txt and not the usual way, is I am trying to configure the Pine64 using a link-local connection to my computer. It's directly linked to it using a single ethernet cable, so there is no DHCP server. If everything is set up manually it should still work this way...

i tried using the following, but it does *not* work (fromĀ http://textuploader.com/xodk)

Code:
ipaddr=192.168.0.101
serverip=192.168.0.100
gateway=192.168.0.1
netmask=255.255.255.0
hostname=pine64.local
ip=${ipaddr}:${serverip}:${gateway}:${netmask}:${hostname}:eth0:off



RE: possible to set a static IP using uEnv.txt? - lenny.raposo-pine64.pro - 04-25-2016

You can set it with

/etc/network/interfaces

and add this to the file (using 192.168.1.100 as the static in this example)

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 4.2.2.1 4.2.2.2 8.8.8.8



and to set hostname do this

echo myhostname > /etc/hostname


now edit /etc/hosts

and add an entry like so

127.0.0.1 localhost
192.168.1.100 myhostname

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

then reboot Wink


RE: possible to set a static IP using uEnv.txt? - RanTalbott - 05-13-2016

I'm using the latest 16.04 image (xubuntu-xenial-20160501-longsleep-pine64-8GB.zip)

In addition to changing /etc/network/interfaces as described by lenny, I removed the include for interfaces.d so it wouldn't bring in the definition for eth0 from there.

I also had to fix a common problem with recent ubuntu releases with static IPs: /etc/resolv.conf is a symlink to a file created during startup by some network manager program. If you're using a static IP, it doesn't honor your nameserver entries. You need to rm the symlink, and install your own resolv.conf.