Comments (6)
to fix ip address
sudo nano /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.97
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8
ctrl+x and tape y than ENTER
don't forget to use your own address, network, broadcast and gateway
the gateway address is the address of your internet router, the one you use to get access to modem panel, for network generally the first 3 par (for me 192.168.1.) and add 0, for broadcast same as before but it end with 255, the gateway should already be calculated, for dns-nameservers you can use the same ( it's of google)
from device-init.
This has been open for nearly a year; any plans to make it a reality? I'm looking for a solution to recovery from a power outage where my dhcp server isn't up yet when the pi boots.
from device-init.
Dear @tsouhaieb ,
your fix is working indeed but the dns-nameservers are not copied over to the /etc/resolv.conf
file.
After every reboot I need to add the nameservers to re-establish the network-connection with sudo /etc/resolv.conf
.
Is there a fix already present or perhaps another solution?
best regards
from device-init.
the workaround works but would be great to have a solution with config and without a need to log in to the pi and set this manually. This is useful when using a cluster (k8s) you dont want IP to change. thanks
from device-init.
We no longer actively maintain device-init any longer. HypriotOS 1.7.0 switched to cloud-init.
Here is an example to set a static IP address with the user-data cloud-config file.
https://github.com/hypriot/flash/blob/master/sample/static.yml
from device-init.
We no longer actively maintain device-init any longer. HypriotOS 1.7.0 switched to cloud-init.
Here is an example to set a static IP address with the user-data cloud-config file.
https://github.com/hypriot/flash/blob/master/sample/static.yml
Yep and using that exact example file (with IP addresses edited to suit) and flash (2.7.0) to burn Hypriot 1.12.3 to SD does not result in a static IP being set when RPi booted with SD inserted. The RPi still is running on auto IP via DHCP. Any hacks to set a static IP have knock on problems.
Command line that uses your suggestion @StefanScherer but does not result in static IP working:
flash --userdata static.yaml hypriotos-rpi-v1.12.3.img.zip
Noting /etc/dhcpcd.conf is definitely set according to --userdata.
Noting /etc/resolv.conf is auto populated with name servers, pull from gateway via DHCP server on gateway, and so name resolution is provided.
However IP is provided DHCP and not static.
Noting also that if static IP hack is used to "fix" the problem with --userdata method failing, /etc/resolv.conf will end up empty of references to nameservers and you therefore don't get name resolution. For example, using Hypriot 1.12.3 with static IP hacks and no name services means you cannot pull docker images since you cannot find the hub on the internet.
The missing nameservers in /etc/resolv.conf is because all suggested hacks, for getting around --userdata method failing, involve disabling cloud-init. Understanding also that a warning is provided in /etc/resolv.conf to the effect manual entry of nameservers is verboten, because the contents of /etc/resolv.conf will be automatically replaced.
Something clearly needs to be done to allow static IP being set that doesn't require hacks and takes account of the problems with setting of static IP, including disabling of cloud-init, and therefore of dropping access to nameservers. Copying junk into /etc/dhcpcd.conf does not appear to help nor does the other hacks on offer.
from device-init.
Related Issues (20)
- Add support for adding WiFi configuration HOT 1
- FQDN still reported as localhost
- /var/log logfiles show localhost instead of configured hostname
- Refactor device-init to not use sub-commands any more
- Run device-init in different phases of the boot process
- Allow setting password for pirate user. HOT 5
- Add a new 127.0.0.1 $hostname entry in /etc/hosts on boot time HOT 3
- Add hidden SSID support HOT 6
- Remove show commands
- Make device-init run after docker service in systemd
- Support multiple wifi alternatives HOT 1
- Allow wifi connection to include optional identity
- Suggestion: run command after docker images are preloaded
- Question: tips on how to install docker image with debootstrap?
- Not able to edit /boot/device-init.yaml HOT 2
- Error with hostname set servername HOT 2
- Non functional Docker build HOT 1
- user-data instead of device-init?
- Integrate BerryLan for easy WiFi activation
- (feat) device-init.yaml schema documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from device-init.