Linux/IPv4: Difference between revisions

From Wiki
No edit summary
Line 16: Line 16:
</pre>
</pre>
</blockquote>
</blockquote>
[[Category:Linux/Network]]
 
[[Category:Linux]]


== netplan (Ubuntu 18.04+) ==
== netplan (Ubuntu 18.04+) ==
Line 32: Line 31:
     version: 2
     version: 2
</pre>
</pre>
[[Category:Linux/Network]]
[[Category:Linux]]

Revision as of 08:26, 8 April 2019

/etc/network/interfaces

  • dhcp
iface eth0 inet dhcp
  • static
iface eth0 inet static
    address 192.168.0.97   
    netmask 255.255.255.0  
    gateway 192.168.0.1
    dns-nameservers 192.168.0.1 10.10.0.2


netplan (Ubuntu 18.04+)

  • static
network:
    ethernets:
        enp0s3:
            addresses: [192.168.1.2/24]
            gateway4: 192.168.1.1
            nameservers:
              addresses: [8.8.8.8,8.8.4.4]
            dhcp4: no
    version: 2