Centos7 포트 매핑

포트 8080에 NAT 포트 매핑을 기본 포트 번호를 변경하지 않고 바람둥이에, 포트 번호 8080에 액세스 추가하는 데 필요한 바람둥이 플러스 액세스,지도 포트 (80)를 연 후, 8080 액세스하지 않고 달성 할 수있다.

체인 NAT 테이블 PREROUTING의 끝에 "8080에 매핑 대상 포트 (80),"추가 항목

80 --dport의 iptables -t NAT -A PREROUTING -p TCP 리디렉션 -j --to 포트 8080

 

포트 매핑 명령 (> 8080 80)

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

다시 시작이 실패합니다 후.

명령을 저장 :

service iptables save

이 명령없이 centos7 :

# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, 
force-reload, status). For other actions, please try to use systemctl. 

해결 방법 :
1. 먼저 다음 명령을 실행합니다 :

systemctl stop firewalld
systemctl mask firewalld

2. iptables에 서비스를 설치

yum install iptables-services

부팅을 설정합니다

systemctl enable iptables

4. 다시 시작의 iptables 서비스

systemctl restart iptables

5. 저장 구성 명령을 실행

service iptables save

추천

출처www.cnblogs.com/kinwing/p/11202847.html