高级网络配置
1.链路聚合
1)bond
systemctl status NetworkManager
nmcli connection show
nmcli connection delete “System eth0”
nmcli connection show
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.182/24
nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0
nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 up
ifconfig eth1 up
ifconfig eth1 down
ifconfig eth1 up
ifconfig eth0 down
###############ctrl+shift+n
watch -n 1 cat /proc/net/bonding/bond0
###############ctrl+shift+n
ping 172.25.254.52
删除bond连接
nmcli connection delete bond0
nmcli connection delete eth0
nmcli connection delete eth1
2)team
nmcli connection add con-name team0 ifname team config ‘{“runner”:{“name”:”activebackup”}}’ ip4 172.25.254.182/24
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth1 down
ifconfig eth1 up
#################ctrl+shift+n
teamdctl team0 stat
#################ctrl+shift+n
ping 172.25.254.52
2.虚拟机网卡与真机的桥接
文件形式
cd /etc/sysconfig/network-scripts
ls
mkdir /backup
mv ifcfg-br0 ifcfg-enp0s25 /backup/
ls
nm-connection-editor(除virbr1、virbr0外全部删除)(创建westos)
vim ifcfg-westos
(BOOTPROTO=none
DEVICE=enp0s25
ONBOOT=yes
BRIDGE=br0)
vim ifcfg-br0
(DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.52
PREFIX=24
TYPE=Bridge)
systemctl restart network
ifconfig
brctl show
#################删除桥接
cd /etc/sysconfig/network-scripts/
ls
rm -rf ifcfg-br0 ifcfg-westos
mv /backup/* .
ls
systemctl restart network
==================================================**
指令形式
brctl adbr br0
brctl show
brctl addif br0 eth0
brctl show
ping 172.25.254.52
################删除
brctl delifbr0 eth0
brctl show
ifconfig br0 down
ifconfig
brctl show
brctl delbr br0
brctl show
===================================================================================================
dns
yum instsall bind -y
systemctl start named
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { any; };
forwarders {114.114.114.114;};
systemctl start named
ll /etc/rndc.key
systemctl stop firewalld
测试主机更改/etc/solv.conf nameserver=上面的主机ip
3.正向解析
vim /etc/named.rfc1912.zone
zone “westos.com” IN {
type master;
file “westos.com.zone”;
allow-update { none; };
cd /var/named
cp -p named.localhost westos.com.zone
vim westos.com.zone
TTL1D@INSOAdns.westos.com.root.westos.com.(0;serial1D;refresh1H;retry1W;expire3H);minimumNSdns.westos.com.dnsA172.25.254.100wwwA172.25.254.1bbsCNAMElinuxlinuxA172.25.254.111linuxA172.25.254.222westos.com.MX1172.25.254.250.测试清空日志>/var/spool/mail/root发送日志mailroot@westos.com查看是否成功反向解析vim/etc/named.rfc1912.zoneszone“254.25.172.in−addr.arpa”INtypemaster;file“westos.com.ptr”;allow−updatenone;;;2.cp−pnamed.loopbackwestos.com.ptr3.vimwestos.com.ptr
T
T
L
1
D
@
I
N
S
O
A
d
n
s
.
w
e
s
t
o
s
.
c
o
m
.
r
o
o
t
.
w
e
s
t
o
s
.
c
o
m
.
(
0
;
s
e
r
i
a
l
1
D
;
r
e
f
r
e
s
h
1
H
;
r
e
t
r
y
1
W
;
e
x
p
i
r
e
3
H
)
;
m
i
n
i
m
u
m
N
S
d
n
s
.
w
e
s
t
o
s
.
c
o
m
.
d
n
s
A
172.25.254.100
w
w
w
A
172.25.254.1
b
b
s
C
N
A
M
E
l
i
n
u
x
l
i
n
u
x
A
172.25.254.111
l
i
n
u
x
A
172.25.254.222
w
e
s
t
o
s
.
c
o
m
.
M
X
1
172.25.254.250.
测
试
清
空
日
志
>
/
v
a
r
/
s
p
o
o
l
/
m
a
i
l
/
r
o
o
t
发
送
日
志
m
a
i
l
r
o
o
t
@
w
e
s
t
o
s
.
c
o
m
查
看
是
否
成
功
反
向
解
析
v
i
m
/
e
t
c
/
n
a
m
e
d
.
r
f
c
1912.
z
o
n
e
s
z
o
n
e
“
254.25.172.
i
n
−
a
d
d
r
.
a
r
p
a
”
I
N
t
y
p
e
m
a
s
t
e
r
;
f
i
l
e
“
w
e
s
t
o
s
.
c
o
m
.
p
t
r
”
;
a
l
l
o
w
−
u
p
d
a
t
e
n
o
n
e
;
;
;
2.
c
p
−
p
n
a
m
e
d
.
l
o
o
p
b
a
c
k
w
e
s
t
o
s
.
c
o
m
.
p
t
r
3.
v
i
m
w
e
s
t
o
s
.
c
o
m
.
p
t
r
TTL 1D
@ IN SOA dns.westos.com. root.westos.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS dns.westos.com.
dns A 172.25.254.100
111 PTR bbs.westos.com.
110 PTR www.westos.com.
systemctl restart named
~
~
~
~