Linux基础邮件服务和交换空间 聚合连接(Engineer08----DAY15)

基础邮件服务

虚拟机classroom:DNS服务器
server0.example.com

邮箱账户: [email protected]
[email protected]

电子邮件通信
• 电子邮件服务器的基本功能
– 为用户提供电子邮箱存储空间(用户名@邮件域名)
– 处理用户发出的邮件 —— 传递给收件服务器
– 处理用户收到的邮件 —— 投递到邮箱

快速部署postfix邮件服务器
• 装包、配置、起服务

虚拟机server:
1.安装postfix软件
[root@server0 ~]# yum -y install postfix
[root@server0 ~]# rpm -q postfix
postfix-2.10.1-6.el7.x86_64

2.修改配置文件
[root@server0 ~]# vim /etc/postfix/main.cf
vim末行模式:set nu #开行号功能

99 myorigin = server0.example.com #默认补全域名后缀

116 inet_interfaces = all #在本机的所有网卡均提供邮件功能

164 mydestination = server0.example.com #判断本域邮件的依据

3.重起服务
[root@server0 ~]# systemctl restart postfix
[root@server0 ~]# systemctl status postfix #查看服务报错信息

##########################################################
使用mail命令发信/收信
• mail 发信操作:mail -s ‘邮件标题’ -r 发件人 收件人[@收件域]…
[root@server0 ~]# useradd yg
[root@server0 ~]# useradd xln
[root@server0 ~]# mail -s ‘test01’ -r yg xln
hahaxixi
.
EOT
[root@server0 ~]# echo xixi | mail -s ‘test02’ -r yg xln

• mail 收信操作:mail [-u 用户名]
[root@server0 ~]# mail -u xln
Heirloom Mail version 12.5 7/5/10. Type ? for help.
“/var/mail/xln”: 1 message 1 new

N 1 [email protected] Mon Dec 16 10:09 19/586
& 1 #输入邮件的编号,回车

##########################################################
准备交换空间(虚拟内存):
可以利用硬盘的空间,充当内存,缓解物理内存的压力。

1.划分新分区,parted分区工具(专门用于划分GPT分区模式)

GPT分区模式:支持128个主分区  最大空间支持18EB
           1EB=1024PB  1PB=1024TB

[root@server0 ~]# lsblk
[root@server0 ~]# parted /dev/vdb
(parted) mktable gpt #指定分区表模式
(parted) mkpart #划分新的分区
分区名称? []? haha #分区的名称,随意写
文件系统类型? [ext2]? ext4 #分区的文件系统,随意写
起始点? 0 #起始点
结束点? 2G #结束点
忽略/Ignore/放弃/Cancel? Ignore #忽略
(parted) print #输出分区表信息
(parted) unit GB #采用GB作为单位
(parted) print
(parted) mkpart
分区名称? []? haha
文件系统类型? [ext2]? ext4
起始点? 2G
结束点? 5G
(parted) print
(parted) quit
[root@server0 ~]# lsblk

2.格式化交换文件系统
[root@server0 ~]# mkswap /dev/vdb1
[root@server0 ~]# mkswap /dev/vdb2

[root@server0 ~]# blkid /dev/vdb1
[root@server0 ~]# blkid /dev/vdb2

3.启用交换分区
[root@server0 ~]# swapon /dev/vdb1
[root@server0 ~]# swapon -s

[root@server0 ~]# swapon /dev/vdb2
[root@server0 ~]# swapon -s

[root@server0 ~]# swapoff /dev/vdb1 #停用交换分区
[root@server0 ~]# swapon -s

4.开机自动启用
[root@server0 ~]# vim /etc/fstab
/dev/vdb1 swap swap defaults 0 0
/dev/vdb2 swap swap defaults 0 0

[root@server0 ~]# swapon -s
[root@server0 ~]# swapon -a #专用于检测交换分区是否书写正确
[root@server0 ~]# swapon -s
#######################################################
配置聚合连接(链路聚合)

作用:解决网卡的单点故障,备份网卡设备
热备份

                eth1       eth2  
 
               虚拟网卡:         team0
                                    192.168.1.1

• team,聚合连接(也称为链路聚合)
– 由多块网卡(team-slave)一起组建而成的虚拟网卡,即“组队”
– 作用:热备份(activebackup)连接冗余

1.建立虚拟的网卡team0, 参考man teamd.conf 进行/example全文查找

[root@server0 ~]# nmcli connection add type team
ifname team0 con-name team0 autoconnect yes
config ‘{“runner”: {“name”: “activebackup”}}’

]# ifconfig
]# ls /etc/sysconfig/network-scripts/ifcfg-team0 #生成的网卡配置文件

[root@server0 ~]# nmcli 连接网络 添加 类型 team
网卡名 team0 配置文件名 team0 每次开机自动启用
工作方式 热备份方式

2.添加成员
[root@server0 ~]# nmcli connection add type team-slave
ifname eth1 con-name team0-1 autoconnect yes master team0

[root@server0 ~]# nmcli connection add type team-slave
ifname eth2 con-name team0-2 autoconnect yes master team0

[root@server0 ~]# nmcli 连接网络 添加 类型 组队中从设备
网卡名 eth2 配置文件名 team0-2 每次开机自动启用 主设备为 team0

3.为team0配置IP地址
[root@server0 ~]# nmcli connection modify team0
ipv4.method manual ipv4.addresses 192.168.1.1/24
connection.autoconnect yes

[root@server0 ~]# nmcli connection up team0
[root@server0 ~]# nmcli connection up team0-1
[root@server0 ~]# nmcli connection up team0-2

[root@server0 ~]# ifconfig
[root@server0 ~]# teamdctl team0 state #专用于查看team0信息

#########################################################
如果失败了,请删除所有配置,从新来过
[root@server0 ~]# nmcli connection delete team0
[root@server0 ~]# nmcli connection delete team0-1
[root@server0 ~]# nmcli connection delete team0-2
#########################################################
配置IPv6地址

• IPv4 地址表示
– 32个二进制位,点分隔的十进制数
– 例如:172.25.0.11、127.0.0.1

• IPv6 地址表示
– 128个二进制位,冒号分隔的十六进制数
– 每段内连续的前置 0 可省略、连续的多个 : 可简化为 ::
– 例如: 2003:ac18:0000:0000:0000:0000:0000:0305
2003:ac18::305/64

]# ifconfig eth0
]# nmcli connection modify ‘System eth0’
ipv6.method manual
ipv6.addresses 2003:ac18::305/64
connection.autoconnect yes

]# nmcli connection up ‘System eth0’
]# ifconfig eth0

]# ping6 2003:ac18::305

################################################

发布了55 篇原创文章 · 获赞 0 · 访问量 426

猜你喜欢

转载自blog.csdn.net/weixin_45533230/article/details/103717492
今日推荐