Centos 7.5 network configuration, centos7.5 Configuration
1. The ifconfig command cannot be found.
Solution: install the net-tools.x86_64 toolkit yum install net-tools.x86_64
2. iptables cannot be used.
Solution: yum install iptables-services
Vi/etc/sysconfig/iptables # Configure Firewall Parameters
# Sample configuration for iptables service
# You can edit this manually or use system-config-firewall
# Please do not ask us to add additional ports/services to this default configuration
* Filter
: Input accept [0: 0]
: Forward accept [0: 0]
: Output accept [0: 0]
-A input-m state -- state RELATED, ESTABLISHED-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-I lo-j ACCEPT
-A input-p tcp-m state -- state NEW-m tcp -- dport 22-j ACCEPT
-A input-j REJECT -- reject-with icmp-host-prohibited
-A forward-j REJECT -- reject-with icmp-host-prohibited
COMMIT
: Wq! # Save and exit
Systemctl restart iptables. service # restart the firewall to make the configuration take effect.
Systemctl enable iptables. service # Set firewall startup