Edit LAN IP via SSH

Hi,

So my Pi sits in a cupboard so I can remote into it when needed and use SSH.
What I found was if I remote in with XRDP I can't get the LAN settings.
Editing netplan doesn't seem to work.

I have to login to the machine locally to edit those IP settings in the GUI.

Is there SSH commands I can use to edit the IP settings? Static IP, DNS, Gateway etc.

Or is it only locally via the GUI?

1 Like

I assume you run Ubuntu Mate on the pi and say, its ip is 192.168.1.100 You are able to ssh to the pi and would like to modify ip. You can edit the netplan file in /etc/netplan with sudo.

Change the ip to 192.168.1.200, make sure your netplan is correct, and reboot. The pi will have this new ip and you can ssh to the new ip. The old ip is gone.

Does this help?

I tried that and makes no change. Once saved it gets listed as a new eth01 in network config in the GUI below the LAN that is in use. Reboot has no effect. It's like it gets the network settings from a different config?
Everything I read says netplan should control it, but doesn't do anything for me.
I run netplan test, and apply, reboot but in network config it still shows LAN and then netplan-eth01. No change to system IP via netplan.

can you post your netplan file here?

So my netplan by default contains no settings:
Annotation%202020-01-30%20075423

My Network connections are like this:

I can then edit netplan and apply& reboots with these settings:
Annotation%202020-01-30%200754232h

That connection gets shown in network config, but never is used as the other LAN is still set:

if your physical interface is eth0, why do you want to change it to eth01? you cannot rename a physical interface, if your system says eth0, that's it. Unless you modify rules in /etc/udev/rules.d/

are you trying to make an alias? that would be eth0:0 or eth0:1

Any time you modify netplan, activate with sudo netplan apply
commands ifconfig or ip a will show the immediate changes.

Is your system a DNS server? nameservers: tag has google or other public DNS
nameservers:
[tab] addresses: [8.8.8.8, 8.8.4.4]

Think you have proof-read my issue!

I should be putting eth0 not eth01!

Will test that and let you know.

Yes, my system is a DNS server.

Yep that solved it!

Sometimes a second set of eyes finds the simple issue!

How come network connections now shoes Lan & netplan-eth0 as active connections?? Wouldn't it just show one?

1 Like

maybe it remembers from yesterday -- you should have only one connection, eth0 with 192.168.0.6

Yeah one connection according to ip addr.

Thanks for your help!

you're welcome ... maybe mark this thread as solved (it may help someone in the future).

1 Like

Why bother? I set my Pi's up and reserved the ip address on the router.