Search

Nat Instance

22, 80, 443 any open
Userdata
sudo yum install iptables-services -y sudo systemctl enable iptables sudo systemctl start iptables
Shell
복사
sudo su
Shell
복사
sudo cat << EOF > /etc/sysctl.d/custom-ip-forwarding.conf net.ipv4.ip_forward=1 EOF
Shell
복사
sudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf
Shell
복사
netstat -i
Shell
복사
sudo /sbin/iptables -t nat -A POSTROUTING -o ens5 -j MASQUERADE # 필요시 수정 sudo /sbin/iptables -F FORWARD sudo service iptables save
Shell
복사
Instance의 EIP 할당
활성화 후 저장

NAT Instance AMI 생성