Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ssh remoteuser@40.40.40.40 -L 3306:127.0.0.1:3306 -N
- $ mysql -udb_user -h127.0.0.1 -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or g.
- [...]
- # iptables -t nat -A PREROUTING -d 40.40.40.40 -p tcp --dport 3306 -j DNAT --to-destination 127.0.0.1:3306
- # iptables -L -t nat
- Chain PREROUTING (policy ACCEPT)
- target prot opt source destination
- DNAT tcp -- anywhere 40.40.40.40 tcp dpt:mysql to:127.0.0.1:3306
- 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
- #cat /proc/sys/net/ipv4/ip_forward
- 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement