User Tools

Site Tools


networking:linux:static_ip_addr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
networking:linux:static_ip_addr [2021/08/20 09:54]
gcooper
networking:linux:static_ip_addr [2022/04/28 08:35]
gcooper
Line 21: Line 21:
 ===== Netplan ===== ===== Netplan =====
  
-==== Ubuntu 20.04 (bonded) ====+https://netplan.io/examples/
  
-<file> +https://blog.ubuntu.com/2017/07/05/quick-and-easy-network-configuration-with-netplan
-network: +
-  bonds: +
-    bond0: +
-      interfaces: +
-      - enp0s8 +
-      - enp0s9 +
-      addresses: [10.1.1.19/24] +
-      gateway4: 10.1.1.1 +
-      nameservers: +
-                search: [internaldomain, externaldomain] +
-                addresses: [10.1.1.20, 10.1.1.21] +
-      parameters: +
-        mode: balance-rr +
-  ethernets: +
-    enp0s8: {} +
-    enp0s9: {} +
-  version: 2 +
-</file>+
  
-==== Ubuntu 18.04 ====+https://blog.ubuntu.com/2017/12/01/ubuntu-bionic-netplan
  
-:!: Indenting is very important!+:!: **Indentation** is very important!
  
-:!: We use 'netplan' and 'networkd' for network configuration.+:!: We use ''netplan'' and ''networkd'' for network configuration.
  
-:!: YAML files can be named differently. +:!: YAML files can be **renamed**.
- +
-https://blog.ubuntu.com/2017/07/05/quick-and-easy-network-configuration-with-netplan +
- +
-https://blog.ubuntu.com/2017/12/01/ubuntu-bionic-netplan+
  
   * bonds   * bonds
Line 61: Line 39:
   * static addresses   * static addresses
   * DHCP addresses   * DHCP addresses
 +
 +==== Regenerate and Reapply After Editing ====
 +
 +<file>
 +sudo netplan --debug generate
 +sudo netplan --debug apply
 +</file>
 +
 +==== Ubuntu 18/20/22 (LACP Bond) ====
 +
 +<file>
 +network:
 +  version: 2
 +  ethernets:
 +    enp0s8:
 +      dhcp4: no
 +    enp0s9:
 +      dhcp4: no
 +  bonds:
 +    bond0:
 +      interfaces: [enp0s8, enp0s9]
 +      addresses: [10.1.1.19/24]
 +      routes:
 +        - to: default
 +          via: 10.1.1.1
 +      nameservers:
 +        search: [internal.domain, domain]
 +        addresses: [10.1.1.20, 10.1.1.21]
 +      parameters:
 +        mode: 802.3ad
 +        transmit-hash-policy: layer3+4
 +        mii-monitor-interval: 1
 +</file>
 +
 +==== Ubuntu 18/20/22 (Static) ====
  
 <file> <file>
Line 66: Line 79:
 </file> </file>
  
-<note tip>To suppress (or define) the default IPv6 ''link-local'' address (''fe80::''), add this to the interface definition (same indentation as ''addresses: []''):+<note tip>To suppress (or define) the default IPv6 ''link-local'' address (''fe80::''), add this to the interface definition (same indentation as ''addresses:''):
  
 ''link-local: []'' ''link-local: []''
Line 75: Line 88:
 <file> <file>
 network: network:
-    ethernets: +  ethernets: 
-        eth0: +    eth0: 
-            addresses: [10.1.1.17/24] +      addresses: [10.1.1.17/24] 
-            gateway4: 10.1.1.1 +      routes: 
-            nameservers: +        - to: 0.0.0.0/0 
-              addresses: [10.1.1.20,10.1.1.21] +          via: 10.0.0.1 
-        eth1: +      nameservers: 
-            addresses: [10.1.9.17/24] +        addresses: [10.1.1.20,10.1.1.21] 
-            mtu: 9000 +    eth1: 
-    version: 2+      addresses: [10.1.9.17/24] 
 +        mtu: 9000 
 +version: 2
 </file> </file>
  
-<file> +==== Troubleshooting ====
-sudo netplan --debug generate +
-sudo netplan --debug apply +
-</file>+
  
-If you have trouble, try removing these files, then regenerate and reapply:+If you have trouble with netplan, try removing these files, then regenerate and reapply:
  
   * Extra addresses   * Extra addresses
networking/linux/static_ip_addr.txt · Last modified: 2023/05/02 14:34 by gcooper