2

It looks like netplan is the future, but compared to this simple command:

ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

it's much more work to edit the annoying yaml file (the yaml parser feels like a 20 years old technology…).

Does someone know a nice tool to modify the netplan config by just using the command line?

  • If you're using a desktop machine, or using wireless, or VPN, then NetworkManager should be used. If you've got a server, which remains fairly static, then netplan should be used. Once your .yaml file is edited, generated, and applied, you shouldn't have to regularly change/edit it. Edit your question and show me cat /etc/netplan/*.yaml. – heynnema Apr 5 at 20:54
  • If you are using an Ubuntu version that uses netplan, it is very doubtful that your ethernet interface is eth0. Please double-check: ip add show – chili555 Apr 6 at 2:25
  • @chili555 thanks for your note, I really use netplan and ip add show displays eth0: … – Tom Apr 6 at 23:12
  • @heynnema thanks for your clarification, but we just expect that a modern technology offers both: a configuration file, which can be modified by shell commands, too. So we can choose the more useful way depending on the situation :-) – Tom Apr 6 at 23:17
1

The ifconfig command still exists in Ubuntu, but there is no equivalence between what ifconfig and netplan are intended to do. ifconfig is a tool for modifying the current state of an interface on the system. netplan is a tool for persistently managing the configuration of the network on a system.

If you know how to configure your network interfaces with a series of ifconfig commands, you could add a systemd unit or init script to run these at boot, but this would be less well integrated with the system's boot than using netplan.

There are presently no command line tools for editing netplan configuration.

0

You might find this page useful:

https://p5r.uk/blog/2010/ifconfig-ip-comparison.html

For example :

ip addr add 192.168.0.77/24 broadcast 192.168.0.255 dev eth0
  • Thank you very much for this useful link!, it's a shame that new technology like netplan does not offer a command line interface. – Tom Apr 6 at 23:10
  • 1
    @Tom Of course, but the 'old' technology did not offer a direct command line interface either. The ifconfig command does not alter the /etc/network/interfaces file, it modifies the configuration that the interfaces file has initialized. The netplan configuration is the same -- an initialization. The 'new' ip command like the ifconfig command modifies that configuration in place. I wonder too why those who build our systems are driven to fix things that work, but that is the world we're in and it keeps us on our toes. – Stephen Boston Apr 7 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.