搭建公网IPV6服务器

我们有时候需要搭建一个IPV6服务器, 需要IPV6地址,相对于有线网络复杂的IPV6配置, 用蜂窝网络去获取一个公网IPV6显得就很简单。

需要的设备: 联通SIM 卡, CAT1 开发板(或者Modem)

环境准备: SIM卡插在CAT1开发板上,开发板通过USB连到电脑,安装好驱动。 这时候,在设备管理器上你可以看到相关端口

实验步骤:

1  设置APN , 激活网络

   相关的AT命令为:

AT+CGDCONT=1, "IPV4V6", "3gnet"

AT+CGACT=1,1

可以通过  AT+CGDCONT? 命令来查看是否获取到地址

2  配置电脑modem 

 关键点是拨号的端口要选择AT端口。

3 设置网络拨号

这一步相对简单

这时候你可以通过ipconfig 命令来查看获取到的IPV6地址, 有了这公网地址, 可以搭建任何的IPV6服务器了。

以下是在CentOS 7上搭建公网邮件服务器的步骤: 1. 安装必要的软件包: ```shell yum install postfix dovecot cyrus-sasl-* mailx -y ``` 2. 移除Sendmail(如果已安装): ```shell yum remove -y sendmail ``` 3. 配置Postfix: 编辑主配置文件`/etc/postfix/main.cf`,确保以下配置项正确设置: ```shell myhostname = your_domain.com # 设置你的域名 mydomain = your_domain.com # 设置你的域名 myorigin = $mydomain inet_interfaces = all inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks = 0.0.0.0/0 home_mailbox = Maildir/ ``` 4. 配置Dovecot: 编辑Dovecot的邮件配置文件`/etc/dovecot/conf.d/10-mail.conf`,取消注释并添加以下行: ```shell mail_location = maildir:~/Maildir ``` 5. 配置SASL认证: 编辑SASL配置文件`/etc/postfix/sasl/smtpd.conf`,确保以下配置项正确设置: ```shell pwcheck_method: saslauthd mech_list: plain login ``` 6. 启动和设置服务: ```shell systemctl start postfix systemctl enable postfix systemctl start dovecot systemctl enable dovecot systemctl restart saslauthd systemctl enable saslauthd ``` 7. 配置防火墙: 如果你的服务器上启用了防火墙,确保允许SMTP(端口25)和IMAP(端口143)流量通过防火墙。 8. 创建邮件用户: ```shell useradd -m -s /sbin/nologin username # 替换username为你想要创建的用户名 passwd username # 设置用户密码 ``` 现在你已经成功搭建了CentOS 7上的公网邮件服务器
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值