Skip to content

Instantly share code, notes, and snippets.

@fo40225
Last active May 10, 2020 20:08
Show Gist options
  • Save fo40225/ad95706d3fdd326cac9f97fd7d9c1cde to your computer and use it in GitHub Desktop.
Save fo40225/ad95706d3fdd326cac9f97fd7d9c1cde to your computer and use it in GitHub Desktop.
ubuntu network setting
# ubuntu server 16.04
/etc/network/interfaces
# dhcp
---
auto eth0
iface eth0 inet dhcp
---
# static
---
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 8.8.8.8 1.1.1.1
---
# bond
---
auto enp32s0f0
iface enp32s0f0 inet manual
bond-master bond0
auto enp32s0f1
iface enp32s0f1 inet manual
bond-master bond0
auto bond0
iface bond0 inet dhcp
bond-mode 6
bond-miimon 100
bond-slaves enp32s0f0 enp32s0f1
---
# ubuntu server 18.04
/etc/netplan/*.yaml
# dhcp
---
network:
ethernets:
eth0:
dhcp4: true
dhcp-identifier: mac
---
# static
---
network:
ethernets:
eth0:
addresses:
- 10.10.10.2/24
gateway4: 10.10.10.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
---
# bond
---
ethernets:
enp9s0f0:
dhcp4: no
enp9s0f1:
dhcp4: no
bonds:
bond0:
dhcp4: yes
dhcp-identifier: mac
interfaces:
- enp9s0f0
- enp9s0f1
parameters:
mode: balance-alb
mii-monitor-interval: 100
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment