possible to set a static IP using uEnv.txt?
#1
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
  Reply
#2
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
If you like my work be sure to check out my site or wish to donate to the cause

Cheers Big Grin
  Reply
#3
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.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Configuring static IP danwald10 3 5,210 01-21-2017, 06:31 AM
Last Post: VandaL.pr!

Forum Jump:


Users browsing this thread: 1 Guest(s)