码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu基本配置

时间:2020-08-31 13:13:20      阅读:54      评论:0      收藏:0      [点我收藏+]

标签:网卡   mes   monit   ethernet   setting   int   ast   std   current   

ubuntu的网络配置
官网:https://help.ubuntu.com/

docker/k8s--------------Ubuntu

修改网卡名:eth0
egrep -v "^$|#" /etc/default/grub
sed -i ‘s/(GRUB_CMDLINE_LINUX=")/\1net.ifnames=0/g‘ /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
update-grub

配置网卡:
cat /etc/netplan/eth0.yaml

network:
ethernets:
eth0:
dhcp4: true
version: 2

启动配置:
netplan apply

重启服务器:
reboot

配置静态IP
[21:01:47-root@jack netplan]#egrep -v ^# eth0.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses: [192.168.179.200/24]
gateway4: 192.168.179.2
nameservers:
addresses: [8.8.8.8,114.114.114.114]

查看DNS:
[21:02:02-root@jack netplan]#systemd-resolve --status
Link 2 (eth0)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 8.8.8.8
114.114.114.114

多网卡绑定
[21:31:51-root@jack netplan]#egrep -v "^#" bond.yaml
network:
version: 2
renderer: networkd
ethernets:
eth1:
dhcp4: no
dhcp6: no
eth2:
dhcp4: no
dhcp6: no
bonds:
bond0:
interfaces:

  • eth1
  • eth2
    addresses: [192.168.179.200/24]
    gateway4: 192.168.179.2
    nameservers:
    addresses: [8.8.8.8,114.114.114.114]
    parameters:
    mode: active-backup
    mii-monitor-interval: 100

Ubuntu基本配置

标签:网卡   mes   monit   ethernet   setting   int   ast   std   current   

原文地址:https://blog.51cto.com/13434656/2523587

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!