Ubuntu something configuration

Ubuntu something configuration

1、Disable ipv6

On Ubuntu 16

1
2
3
4
5
6
7
cat >> /etc/sysctl.d/99-sysctl.conf << EOF
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
EOF
sysctl -p
cat /proc/sys/net/ipv6/conf/all/disable_ipv6 #检查显示1即已禁止

2、双网卡绑定

On Ubuntu 16

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dpkg -l | grep fenslave	#检查是否安装负载均衡工具
modprobe bonding #加载模块
lsmod | grep bonding #确认是否加载
cat >> /etc/modules <<EOF
bonding #开机自动加载模块
EOF
cat /etc/network/interface
auto eno1 #要绑定的主网卡
iface eno1 inet manual
bond-master bond0
bond-primary eno1

auto eno2 #要绑定的备网卡
iface eno2 inet manual
bond-master bond0

auto bond0 #绑定的网卡名
iface bond0 inet static #静态地址
address xx.xx.xx.xx #IP
gateway xx.xx.xx.xx #网关
netmask xx.xx.xx.xx #子网
bond-mode active-backup #模式主备
bond-miimon 100 #miimon是100毫秒监测一次网卡状态,如果有一条线路不通就切换另一条线路。
bond-slaves none

reboot