标签:seve data led firewalld 外网 rpm repos rpm包 生效
[root@zeq ~]# systemctl start firewalld
[root@zeq ~]# systemctl enable firewalld
[root@zeq ~]# firewall-cmd --remove-service=ssh --permanent
[root@zeq ~]# firewall-cmd --add-rich-rule='rule family=ipv4 source address=10.0.0.1/32 service name=ssh accept' --permanent
[root@zeq ~]# firewall-cmd --add-masquerade --permanent
[root@zeq ~]# firewall-cmd --reload
[root@eqzhang ~]# /etc/sysconfig/network-scripts/ifcfg-eth1 ? ? ?#配置新增如下2条规则
GATEWAY=172.16.1.61 ?#有外网的服务器内网ip
DNS1=223.5.5.5
[root@eqzhang ~]# nmcli connection down eth1 && nmcli connection up eth1
[root@eqzhang ~]# ping baidu.com
[root@zeq ~]# yum install vsftpd -y
[root@zeq ~]# sed -i '/^keepcache/c keepcache=1' /etc/yum.conf
[root@zeq ~]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1 #这个原来是0 改成1即可
[root@zeq ~]# yum -y install createrepo
[root@zeq ~]# createrepo /var/ftp/ops
#注意: 如果此仓库每次新增软件则需要重新生成一次
[root@zeq ~]# yum -y install
[root@zeq ~]# mkdir -p /var/ftp/ops
[root@zeq ~]# find /var/cache/yum/x86_64/7/ -iname "*.rpm" -exec cp -rf {} /var/ftp/ops \;
[root@zeq ~]# createrepo /var/ftp/ops
[root@zeq ~]# systemctl start vsftpd
[root@zeq ~]# systemctl enable vsftpd
[root@zeq ~]# firewall-cmd --add-service=ftp --permanent
[root@zeq ~]# firewall-cmd --reload
gzip /etc/yum.repos.d/*
cat /etc/yum.repos.d/ops.repo
[ops]
name=local ftpserver
baseurl=ftp://172.16.1.61/ops #填写有外网的服务器内网ip地址
gpgcheck=0
enabled=1
标签:seve data led firewalld 外网 rpm repos rpm包 生效
原文地址:https://www.cnblogs.com/zeq912/p/9996911.html