[精讚] [會員登入]
988

how to deal with ubuntu 18.04 network issues

bring up different ethernet interfaces on installed ubuntu18.04, then fix yaml indentation problem

分享此文連結 //n.sfs.tw/13351

分享連結 how to deal with ubuntu 18.04 network issues@der amateur
(文章歡迎轉載,務必尊重版權註明連結來源)
2020-03-07 13:57:34 最後編修
2019-06-21 11:44:50 By
 

As easy as usual, I moved one hard drive to a different physical machine with ubuntu installed first,

in older versions of ubuntu distributions, it is easy, the OS will determinate what interfaces on the new machine, and bring them up,

if not, just fix these configuration files using command line editor, the problems can be sloved easily.

However, after upgrading to 18.04, the fussy yaml took the place and made network settings more difficult,

I ran into first issue is, the network interface did not bring up automatically,

if you check by using "ip addr", the result is interface "DOWN",

then the "lshw -C network", the result is "*-network DISABLED",

you will have to fix "/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf",

make the content modified to this below:

[keyfile]
unmanaged-devices=*,except:type:ethernet,except:type:wifi,except:type:wwan
 

then restart the service by using command as "service network-manager restart".

If you did it sucessfully, the network configuration will prompt on your desktop settings on the up right side in your desktop version,

then you can modify it based on visual graphical window user interface,

but I want to check yaml,

so the only issue I had is the "indentation",

indentation is everything in a yaml network configuration file,

if your indentation is wrong, the error message instead of telling you anything about your false setting, it just keep saying things like "Error in network definition:","unknown key","expected mapping",

just like JAVA error messages, you just don't know what's wrong with it,

finally, I figured out the great "indentation",

first layer is network, then you have to indent the every setting line below it, no mater two space or one, just remember it,

second layer is renderer, version and ethernets, some examples on search results might tell you that there is no need of these two lines, but it depends on you,

just remeber to indent! they should be placed on same level,

the third layer is the interface name, like enps02, etc.,

indent,

the fourth layer is dhcp4 or dhcp6, and static addresses, gateway,

then the nameservers, if you want to setup nameserver ip addresses, need to "indent" once again,

so a proper yaml may look like this:

# Let NetworkManager manage all devices on this system
network:
 renderer: NetworkManager
 ethernets:
  enp2s0:
   dhcp4: no
   dhcp6: no
   addresses: [x.x.x.x/24]
   gateway4: x.x.x.x
   nameservers:
    addresses: [x.x.x.x,8.8.4.4]
 version: 2

 

just remeber to indent and the levels of indentations.

latest update: a tui interface can solve this issue, by using "nmtui" package which is pre-installed inside system,

however, the debian ecosystem distro like ubuntu may not include this package...

 

 

END

你可能感興趣的文章

how to install teamviewer on ubuntu linux 18.04 LTS install teamviewer by using deb file

how to deal with ubuntu 18.04 network issues bring up different ethernet interfaces on installed ubuntu18.04, then fix yaml indentation problem

how to stop mac os startup sound permanently how to stop mac os startup sound permanently

dealing with virtualbox installation on ubuntu 22.04LTS trouble shooting on virtualbox installation

steps to pass-through usb smart card reader for virtualbox how to pass through usb-smart-card-reader from ubuntu host to virtualbox vm

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

JIRA instance migration phase2: install node.js and chinese fonts install node.js to export PDF though BigPicture plugin

find all elements in listA belonging to each element of listB and to sum according to listA A bookseller has lots of books classified in 26 categories l

dealing with virtualbox installation on ubuntu 22.04LTS trouble shooting on virtualbox installation