zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

ubuntu16.04配置bond0教程

配置教程 ubuntu16.04
2023-06-13 09:13:36 时间

相关文章链接:

centos 7.0双网卡主备和负载均衡模式配置(bond0)

ubuntu16.04配置bond0教程:

环境:ubuntu16.04操作系统 网卡:ens33 ens34

需求:配置bond0、修改主机名、配置DNS和设置root用户可以远程连接

操作步骤:

1、配置bond0

(1)查看系统网卡信息

ifconfig 查看当前网卡情况

ifconfig -a 查看所有网卡信息(包含未启用的网卡)

(2)配置网卡文件

vim /etc/network/interfaces

auto ens33

iface ens33 inet manual

bond-master bond0

auto ens34

iface ens34 inet manual

bond-master bond0

auto bond0

iface bond0 inet static

address 192.168.3.110

netmask 255.255.255.0

gateway 192.168.3.1

dns-nameserver 114.114.114.114

bond-slaves ens33 ens34

bond-mode 1

bond-miimon 100

(3)重启网卡服务

/etc/init.d/networking restart

systemctl restart networking.service

(4)查看bond0是否配置成功

a.查看ens33和ens34网卡MAC地址是否一致

b.查看bond0状态

cat /proc/net/bonding/bond0

2、修改主机名

vim /etc/hostname

ps:更改主机名后需要重启才能生效。

3、配置DNS

配置好IP地址后,需要手动创建/etc/resolv.conf文件,然后写入:

nameserver 114.114.114.114

4、配置远程连接root用户

ps:默认情况下ubuntu系统root用户是无法远程连接的,需要更配置文件

/etc/ssh/sshd_config,然后将其中PermitRootLogin no改为yes,重启ssh服务后可以正常使用root用户连接。

/etc/init.d/ssh restart

总结:

ubuntu系统和centos系统配置bond0方法不一样,需要多实践。