{"version":"https://jsonfeed.org/version/1.1","title":"Jaryl Chng's Knowledge Base","home_page_url":"https://kb.jarylchng.com","feed_url":"https://kb-jarylchng-com.pages.dev/json/","description":"<p>Welcome to the index page of my knowledge base, if you haven't done so, do visit my website at <a href=\"https://jarylchng.com\" rel=\"noopener noreferrer\" target=\"_blank\">https://jarylchng.com</a>.</p><p>I will mainly use this site to document stuff, most of which will likely be in the public domain.</p>","icon":"https://kb-static.jarylchng.com/kb-jarylchng-com/production/images/channel-c68f1f55f856ab833b4365991609dbec.png","favicon":"https://kb-static.jarylchng.com/kb-jarylchng-com/production/images/favicon-b94914f57599a477f9f72dab6bc71001.png","authors":[{"name":"Jaryl Chng"}],"language":"en-us","items":[{"id":"z4FxEVf3KT_","title":"Linux - Port Forwarding Through a VPS With The Help of WireGuard and iptables","url":"https://kb.jarylchng.com/i/linux-port-forwarding-through-a-vps-with-the-hel-z4FxEVf3KT_/","content_html":"<p>Recently I wanted to host a Minecraft server on a network that I can not port forward with. Although this can be done with an SSH tunnel too, I believe Wireguard will give a slightly better performance overall.</p><h2>Commands</h2><h3>Add</h3><pre class=\"ql-syntax\" spellcheck=\"false\">iptables -t nat -A PREROUTING -p tcp -d 123.123.123.123 --dport 25565 -j DNAT --to 10.123.123.123:25565\niptables -A FORWARD -p tcp -d 10.123.123.123 --dport 25565 -j ACCEPT\niptables -t nat -o wg0 -A POSTROUTING -j MASQUERADE\n</pre><h3>Delete</h3><pre class=\"ql-syntax\" spellcheck=\"false\">iptables -t nat -D PREROUTING -p tcp -d 123.123.123.123 --dport 25565 -j DNAT --to 10.123.123.123:25565\niptables -D FORWARD -p tcp -d 10.123.123.123 --dport 25565 -j ACCEPT\niptables -t nat -o wg0 -D POSTROUTING -j MASQUERADE\n</pre><ul><li>Change 123.123.123.123 to your external facing server's public IP address</li><li>Change 10.123.123.123 to the server's Wireguard IP address</li><li>Change all instances of 25565 to a port you wish to forward</li><li>Change wg0 to your Wireguard interface name</li></ul>","content_text":"Recently I wanted to host a Minecraft server on a network that I can not port\nforward with. Although this can be done with an SSH tunnel too, I believe\nWireguard will give a slightly better performance overall.\n\n\nCOMMANDS\n\n\nADD\n\niptables -t nat -A PREROUTING -p tcp -d 123.123.123.123 --dport 25565 -j DNAT --to 10.123.123.123:25565\niptables -A FORWARD -p tcp -d 10.123.123.123 --dport 25565 -j ACCEPT\niptables -t nat -o wg0 -A POSTROUTING -j MASQUERADE\n\n\n\nDELETE\n\niptables -t nat -D PREROUTING -p tcp -d 123.123.123.123 --dport 25565 -j DNAT --to 10.123.123.123:25565\niptables -D FORWARD -p tcp -d 10.123.123.123 --dport 25565 -j ACCEPT\niptables -t nat -o wg0 -D POSTROUTING -j MASQUERADE\n\n\n * Change 123.123.123.123 to your external facing server's public IP address\n * Change 10.123.123.123 to the server's Wireguard IP address\n * Change all instances of 25565 to a port you wish to forward\n * Change wg0 to your Wireguard interface name","date_published":"2024-04-06T16:16:47.919Z","_microfeed":{"web_url":"https://kb-jarylchng-com.pages.dev/i/linux-port-forwarding-through-a-vps-with-the-hel-z4FxEVf3KT_/","json_url":"https://kb-jarylchng-com.pages.dev/i/z4FxEVf3KT_/json/","rss_url":"https://kb-jarylchng-com.pages.dev/i/z4FxEVf3KT_/rss/","guid":"z4FxEVf3KT_","status":"published","itunes:episodeType":"full","date_published_short":"Sat Apr 06 2024","date_published_ms":1712420207919}}],"_microfeed":{"microfeed_version":"0.1.2","base_url":"https://kb-jarylchng-com.pages.dev","categories":[{"name":"Technology"}],"subscribe_methods":[{"name":"RSS","type":"rss","url":"https://kb-jarylchng-com.pages.dev/rss/","image":"https://kb-jarylchng-com.pages.dev/assets/brands/subscribe/rss.png","enabled":true,"editable":false,"id":"sQbXXExV58H"},{"name":"JSON","type":"json","url":"https://kb-jarylchng-com.pages.dev/json/","image":"https://kb-jarylchng-com.pages.dev/assets/brands/subscribe/json.png","enabled":true,"editable":false,"id":"nC8cjLCnOOi"}],"description_text":"Welcome to the index page of my knowledge base, if you haven't done so, do visit\nmy website at https://jarylchng.com.\n\nI will mainly use this site to document stuff, most of which will likely be in\nthe public domain.","copyright":"©2024","itunes:type":"episodic","items_sort_order":"newest_first"}}