# check port 22200
fuser 22200/tcp
# check port 55500
fuser 55500/tcp
firewall-cmd --zone=public --permanent --add-port=22200/tcp
firewall-cmd --zone=public --permanent --add-port=55500/tcp
firewall-cmd --reload
netstat
firewall-cmd --zone=public --permanent --add-port=22200-22290/tcp
firewall-cmd --zone=public --permanent --add-port=55500-55590/tcp
firewall-cmd --reload
netstat
# destination ip & port
CKI_LAN_ADDR=100.43.0.20
CKI_LAN_PORT=22211
# wan interface ip & port
CKI_WAN_ADDR=139.59.51.80
CKI_WAN_PORT=22200
iptables -t nat -A PREROUTING -p tcp -m tcp -d $CKI_WAN_ADDR --dport $CKI_WAN_PORT -j DNAT --to-destination $CKI_LAN_ADDR:$CKI_LAN_PORT
iptables -A FORWARD -m state -p tcp -d $CKI_LAN_ADDR --dport $CKI_LAN_PORT --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -p tcp -m tcp -s $CKI_LAN_ADDR --sport $CKI_LAN_PORT -j SNAT --to-source $CKI_WAN_ADDR
iptables -t nat -D PREROUTING -p tcp -m tcp -d $CKI_WAN_ADDR --dport $CKI_WAN_PORT -j DNAT --to-destination $CKI_LAN_ADDR:$CKI_LAN_PORT
iptables -D FORWARD -m state -p tcp -d $CKI_LAN_ADDR --dport $CKI_LAN_PORT --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -D POSTROUTING -p tcp -m tcp -s $CKI_LAN_ADDR --sport $CKI_LAN_PORT -j SNAT --to-source $CKI_WAN_ADDR