Ref:
https://www.phpini.com/linux/rhel-centos-disable-firewalld-use-iptables
1.Disable firewalld service
[root@testdb11g ~]# systemctl stop firewlald
Failed to stop firewlald.service: Unit firewlald.service not loaded.
[root@testdb11g ~]# systemctl stop firewalld
[root@testdb11g ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@testdb11g ~]# yum install iptables-services
Loaded plugins: langpacks, ulninfo
ol7_UEKR3/x86_64/primary | 25 MB 00:00:02
ol7_UEKR3 588/588
ol7_latest 18642/18642
Resolving Dependencies
--> Running transaction check
---> Package iptables-services.x86_64 0:1.4.21-17.el7 will be installed
--> Processing Dependency: iptables = 1.4.21-17.el7 for package: iptables-services-1.4.21-17.el7.x86_
64
--> Running transaction check
---> Package iptables.x86_64 0:1.4.21-16.el7 will be updated
---> Package iptables.x86_64 0:1.4.21-17.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================
Package Arch Version Repository Size
=====================================================================================================
Installing:
iptables-services x86_64 1.4.21-17.el7 ol7_latest 50 k
Updating for dependencies:
iptables x86_64 1.4.21-17.el7 ol7_latest 424 k
Transaction Summary
=====================================================================================================
Install 1 Package
Upgrade ( 1 Dependent package)
Total download size: 474 k
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/iptables-services-1.4.21-17.el7.x86_64.rpm
: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Public key for iptables-services-1.4.21-17.el7.x86_64.rpm is not installed
(1/2): iptables-services-1.4.21-17.el7.x86_64.rpm | 50 kB 00:00:00
(2/2): iptables-1.4.21-17.el7.x86_64.rpm | 424 kB 00:00:00
-----------------------------------------------------------------------------------------------------
Total 1.8 MB/s | 474 kB 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
Userid : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
Package : 7:oraclelinux-release-7.2-1.0.5.el7.x86_64 (@anaconda/7.2)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : iptables-1.4.21-17.el7.x86_64 1/3
Installing : iptables-services-1.4.21-17.el7.x86_64 2/3
Cleanup : iptables-1.4.21-16.el7.x86_64 3/3
Verifying : iptables-services-1.4.21-17.el7.x86_64 1/3
Verifying : iptables-1.4.21-17.el7.x86_64 2/3
Verifying : iptables-1.4.21-16.el7.x86_64 3/3
Installed:
iptables-services.x86_64 0:1.4.21-17.el7
Dependency Updated:
iptables.x86_64 0:1.4.21-17.el7
Complete!
3. 啟動及設定開機執行 iptables
[root@testdb11g ~]# systemctl enable iptables
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/syst
em/iptables.service.
[root@testdb11g ~]# systemctl start iptables
[root@testdb11g ~]#
沒有留言:
張貼留言