Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@cloud-prod04:~# iptables -F
- root@cloud-prod04:~# iptables -X
- root@cloud-prod04:~# iptables -t nat -F
- root@cloud-prod04:~# iptables -t nat -X
- root@cloud-prod04:~# iptables -t mangle -F
- root@cloud-prod04:~# iptables -t mangle -X
- root@cloud-prod04:~# iptables -P INPUT ACCEPT
- root@cloud-prod04:~# iptables -P FORWARD ACCEPT
- root@cloud-prod04:~# iptables -P OUTPUT ACCEPT
- root@cloud-prod04:~#
- root@cloud-prod04:~#
- root@cloud-prod04:~#
- root@cloud-prod04:~# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
- root@cloud-prod04:~# iptables -t nat -A PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.8.11:8775
- root@cloud-prod04:~# telnet 169.254.169.254 80
- Trying 169.254.169.254...
- telnet: Unable to connect to remote host: Connection refused
- root@cloud-prod04:~# iptables -L -t nat
- Chain PREROUTING (policy ACCEPT)
- target prot opt source destination
- DNAT tcp -- anywhere 169.254.169.254 tcp dpt:http to:10.1.8.11:8775
- Chain INPUT (policy ACCEPT)
- target prot opt source destination
- Chain OUTPUT (policy ACCEPT)
- target prot opt source destination
- Chain POSTROUTING (policy ACCEPT)
- target prot opt source destination
- root@cloud-prod04:~# telnet 10.1.8.11 8775
- Trying 10.1.8.11...
- Connected to 10.1.8.11.
- Escape character is '^]'.
- quit
- ^]quit
- telnet> quit
- Connection closed.
- root@cloud-prod04:~# ^C
- root@cloud-prod04:~# iptables -L
- Chain INPUT (policy ACCEPT)
- target prot opt source destination
- ACCEPT tcp -- anywhere anywhere tcp dpt:http
- Chain FORWARD (policy ACCEPT)
- target prot opt source destination
- Chain OUTPUT (policy ACCEPT)
- target prot opt source destination
- root@cloud-prod04:~# iptables -L -n
- Chain INPUT (policy ACCEPT)
- target prot opt source destination
- ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
- Chain FORWARD (policy ACCEPT)
- target prot opt source destination
- Chain OUTPUT (policy ACCEPT)
- target prot opt source destination
- root@cloud-prod04:~# iptables -L -t nat -n
- Chain PREROUTING (policy ACCEPT)
- target prot opt source destination
- DNAT tcp -- 0.0.0.0/0 169.254.169.254 tcp dpt:80 to:10.1.8.11:8775
- Chain INPUT (policy ACCEPT)
- target prot opt source destination
- Chain OUTPUT (policy ACCEPT)
- target prot opt source destination
- Chain POSTROUTING (policy ACCEPT)
- target prot opt source destination
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement