473 words
2 minutes
Setup TV Direct LAN + Internet Sharing
2026-08-20

Prasyarat#

  • PC dengan 2 interface network:
    • WiFi (internet): wlp1s0
    • Ethernet (ke TV): enp0s31f6
  • Ethernet sudah punya IP static: 192.168.50.1/24
  • Jellyfin sudah jalan di port 8096

Step 1: Setup DHCP Server (TV Auto Dapat IP)#

Install dnsmasq#

Terminal window
sudo apt update
sudo apt install -y dnsmasq

Konfigurasi DHCP untuk interface ethernet#

Terminal window
sudo nano /etc/dnsmasq.d/ethernet.conf

Isi dengan:

interface=enp0s31f6
dhcp-range=192.168.50.100,192.168.50.200,255.255.255.0,12h
dhcp-option=3,192.168.50.1
dhcp-option=6,192.168.50.1,8.8.8.8

Penjelasan:

  • interface=enp0s31f6 — hanya layani DHCP di ethernet
  • dhcp-range=192.168.50.100,192.168.50.200 — range IP untuk client (TV)
  • dhcp-option=3,192.168.50.1 — gateway = IP PC
  • dhcp-option=6,192.168.50.1,8.8.8.8 — DNS server

Restart dnsmasq#

Terminal window
sudo systemctl restart dnsmasq
sudo systemctl enable dnsmasq

Cek status#

Terminal window
sudo systemctl status dnsmasq

Step 2: Setup Internet Sharing (NAT)#

Aktifkan IP Forwarding#

Terminal window
sudo sysctl -w net.ipv4.ip_forward=1

Persist setelah reboot#

Terminal window
echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.d/99-forward.conf

Setup NAT + Firewall Rules#

Terminal window
# NAT dari WiFi ke Ethernet
sudo iptables -t nat -A POSTROUTING -o wlp1s0 -j MASQUERADE
# Allow forwarding dari ethernet ke WiFi
sudo iptables -A FORWARD -i enp0s31f6 -o wlp1s0 -j ACCEPT
# Allow return traffic dari WiFi ke ethernet
sudo iptables -A FORWARD -i wlp1s0 -o enp0s31f6 -m state --state RELATED,ESTABLISHED -j ACCEPT

Buka port untuk TV#

Terminal window
# Jellyfin
sudo ufw allow in on enp0s31f6 to any port 8096 proto tcp
# DHCP
sudo ufw allow in on enp0s31f6 to any port 67 proto udp
# DNS
sudo ufw allow in on enp0s31f6 to any port 53 proto udp

Save rules permanen#

Terminal window
sudo apt install -y iptables-persistent
sudo netfilter-persistent save

Atau manual:

Terminal window
sudo sh -c 'iptables-save > /etc/iptables/rules.v4'

Step 3: Konfigurasi TV#

Di TV, set network ke DHCP/Auto#

  • Masuk ke Settings → Network
  • Pilih Ethernet/LAN
  • Set ke DHCP atau Auto
  • TV akan otomatis dapat IP dari PC

Verifikasi IP TV#

Di PC, cek lease DHCP:

Terminal window
cat /var/lib/misc/dnsmasq.leases

Format: timestamp MAC IP hostname client-id

Contoh output:

1787236133 4c:49:29:95:74:0e 192.168.50.187 * 01:4c:49:29:95:74:0e

Artinya TV dapat IP 192.168.50.187.


Step 4: Akses Jellyfin dari TV#

Opsi 1: Browser TV#

Buka browser di TV, masuk ke:

http://192.168.50.1:8096

Opsi 2: App Jellyfin (jika TV support)#

Install app Jellyfin dari app store TV, lalu:

  • Server address: 192.168.50.1
  • Port: 8096

Step 5: Verifikasi Koneksi#

Cek ARP table (lihat device yang terhubung)#

Terminal window
ip neigh show dev enp0s31f6

Output contoh:

192.168.50.187 lladdr 4c:49:29:95:74:0e REACHABLE

Test internet dari TV#

Di TV, buka browser dan coba:

  • http://8.8.8.8 (Google DNS)
  • http://google.com

Atau ping dari PC ke TV:

Terminal window
ping 192.168.50.187

Troubleshooting#

TV tidak dapat IP#

Terminal window
# Cek dnsmasq jalan
sudo systemctl status dnsmasq
# Cek log
sudo journalctl -u dnsmasq -n 20
# Cek interface ethernet up
ip addr show enp0s31f6

TV dapat IP tapi tidak bisa internet#

Terminal window
# Cek IP forwarding aktif
cat /proc/sys/net.ipv4.ip_forward
# Harus return: 1
# Cek iptables rules
sudo iptables -t nat -L POSTROUTING -v
sudo iptables -L FORWARD -v
# Test ping dari PC ke TV
ping 192.168.50.187

Jellyfin tidak bisa diakses#

Terminal window
# Cek Jellyfin listen di semua interface
ss -tlnp | grep 8096
# Harus: 0.0.0.0:8096
# Cek firewall
sudo ufw status | grep 8096

Rules hilang setelah reboot#

Terminal window
# Pastikan iptables-persistent terinstall
sudo apt install -y iptables-persistent
# Save ulang rules
sudo netfilter-persistent save

Network Topology#

Internet
WiFi (wlp1s0) ← PC (awpetrik) → Ethernet (enp0s31f6)
10.145.168.117 192.168.50.1
DHCP + NAT
Smart TV
192.168.50.187

Flow:

  1. TV dapat IP dari DHCP server di PC
  2. TV akses Jellyfin di 192.168.50.1:8096
  3. TV internet via NAT (PC forward traffic dari ethernet ke WiFi)