Ubuntu 17.10 Configuring static IP addresses

Source: Internet
Author: User

The default is to dynamically assign IP after the system installation is complete

[email protected]:~$ ifconfigens32: flags=4163<up,broadcast,running,multicast>   mtu 1500        inet 192.168.209.221   netmask 255.255.255.0  broadcast 192.168.209.255         inet6 fe80::20c:29ff:fe9b:2437  prefixlen 64  scopeid 0x20<link >        ether 00:0c:29:9b:24:37  txqueuelen  1000   (Ethernet)         RX packets 632   bytes 78029  (78.0&NBSP;KB)         rx errors 0   dropped 0  overruns 0  frame 0         TX packets 440  bytes 56139  (56.1&NBSP;KB)          tx&nbsP;errors 0  dropped 0 overruns 0  carrier 0  collisions  0lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10


The previous version was modified in/etc/network/interfaces and the new version uses/etc/netplan/*.yaml

[Email protected]:~$ cat/etc/netplan/01-netcfg.yaml# This file describes the network interfaces available on your system# For more information, see Netplan (5). Network:version:2 RENDERER:NETWORKD Ethernets:ens32:dhcp4:yes

Edit Yaml file Configuration IP information

[Email protected]:~$ sudo vim/etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your s      ystem# For more information, see Netplan (5). Network:version:2 RENDERER:NETWORKD Ethernets:ens32:dhcp4:no Dhcp6:no addresses: [192.168.209.221/24] gateway4:192.168.209.2 nameservers:addresses: [8.8. 8.8, 114.114.114.114]


Execute the command to have the configuration take effect:

[Email protected]:~$ sudo netplan apply


Display Debug Information

[email protected]:~$ sudo netplan  --debug  apply **  (Generate : 2842):  debug: processing input file //etc/netplan/01-netcfg.yaml.. **  (generate:2842): debug: starting new processing pass**  (generate:2842):  DEBUG: ens32: setting default backend to 1**  (generate:2842):  Debug: generating output files. **  (generate:2842):  debug: networkmanager: definition ens32 is not for  us  (backend 1) debug:netplan generated networkd configuration exists,  Restarting networkddebug:no netplan generated nm configuration existsdebug: device ens32 operstate is up, not repluggingdebug:netplan triggering . link rules for ens32debug:device lo operstate is unknown, not&Nbsp;repluggingdebug:netplan triggering .link rules for lo 


Netplan Other parameter directives:

Netplan generate: Use/etc/netplan to generate/run/systemd/network/10-netplan-ens32.network after execution


Netplan Ifupdown-migrate: Attempt to convert from/etc/network/interfaces to Netplan required YAML format, if conversion succeeds it will prohibit the use of/etc/network/interfaces




This article is from the "Network Favorites" blog, so be sure to keep this source http://liyaoyi.blog.51cto.com/442933/1983481

Ubuntu 17.10 Configuring static IP addresses

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.