Static IP address // DHCP

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
scheiner
Posts: 11
Joined: Mon Oct 29, 2018 1:50 pm

Static IP address // DHCP

Post by scheiner »

Hello,

I'm having trouble changing the IP address from static to DHCP. I'm using my nano pi completely isolated from my router/internet, however, sometime I need to connect it to the internet to update the system and apps.

So from my isolated network I log into and change the IP from Static to DHCP. Do the shutdown and connect the ethernet cable to the router so it can get the IP from DHCP.

When I turn it on it shows 127.0.0.1 on the display and I simply can't access it anymore.

It happened three times and I'm tired of reinstalling everything all the time.

I need help.

Thanks for your attention,
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Static IP address // DHCP

Post by MichaIng »

After you connected to the router. Please try: ifdown eth0 && sleep 2 && ifup eth0
htop shows dhclient running, right? The above should re-initiate the DHCP client as well.

You can check the currently applied (or not applied) IP via: ip a

And you can manually run dhclient as well: dhclient eth0

journalctl might as well give some hints. When connecting the device to the router and trying the above to re-init the interface you could check the journal (end of log) for possible error messages.
scheiner
Posts: 11
Joined: Mon Oct 29, 2018 1:50 pm

Re: Static IP address // DHCP

Post by scheiner »

I can't ssh to the nano pi. It's not getting an IP address.
scheiner
Posts: 11
Joined: Mon Oct 29, 2018 1:50 pm

Re: Static IP address // DHCP

Post by scheiner »

Can I use a USB >> TTL adapter and try to login ???? Or can I plug a keyboard without monitor and try to do a blind login ?
Post Reply