Skip to content

Instantly share code, notes, and snippets.

View amrd24's full-sized avatar
🥔
the potater

Amy amrd24

🥔
the potater
  • amrd24 Networks Inc.
  • Brazil
  • 05:28 (UTC -03:00)
View GitHub Profile
@amrd24
amrd24 / webtv.nft
Last active June 30, 2024 03:23
Service routes for connecting a WebTV unit to a custom server/DNS. Now in NFTables. (what an unfortunate name) Run w/ sudo nft -f webtv.nft and if you experience issues tough luck halen deleted the old gist
# Somewhat experimental version of the WebTV nftables script. Uses IP ranges to cut down on the amount of lines.
define ServerIP = 192.161.48.92 #51.222.164.146 #71.244.121.234
define DNS = 9.9.9.9 #Quad9 DNS Service (https://www.quad9.net/)
add table ip nat
add chain ip nat PREROUTING { type nat hook prerouting priority -100; policy accept; }
add chain ip nat INPUT { type nat hook input priority 100; policy accept; }
add chain ip nat OUTPUT { type nat hook output priority -100; policy accept; }
add chain ip nat POSTROUTING { type nat hook postrouting priority 100; policy accept; }
add rule ip nat PREROUTING ip daddr 10.0.0.0-10.0.255.255 counter dnat to $ServerIP
add rule ip nat PREROUTING ip daddr 192.168.102.0-192.168.102.255 counter dnat to $ServerIP