473 words
2 minutes
Setup TV Direct LAN + Internet Sharing
Prasyarat
- PC dengan 2 interface network:
- WiFi (internet):
wlp1s0 - Ethernet (ke TV):
enp0s31f6
- WiFi (internet):
- 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
sudo apt updatesudo apt install -y dnsmasqKonfigurasi DHCP untuk interface ethernet
sudo nano /etc/dnsmasq.d/ethernet.confIsi dengan:
interface=enp0s31f6dhcp-range=192.168.50.100,192.168.50.200,255.255.255.0,12hdhcp-option=3,192.168.50.1dhcp-option=6,192.168.50.1,8.8.8.8Penjelasan:
interface=enp0s31f6— hanya layani DHCP di ethernetdhcp-range=192.168.50.100,192.168.50.200— range IP untuk client (TV)dhcp-option=3,192.168.50.1— gateway = IP PCdhcp-option=6,192.168.50.1,8.8.8.8— DNS server
Restart dnsmasq
sudo systemctl restart dnsmasqsudo systemctl enable dnsmasqCek status
sudo systemctl status dnsmasqStep 2: Setup Internet Sharing (NAT)
Aktifkan IP Forwarding
sudo sysctl -w net.ipv4.ip_forward=1Persist setelah reboot
echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.d/99-forward.confSetup NAT + Firewall Rules
# NAT dari WiFi ke Ethernetsudo iptables -t nat -A POSTROUTING -o wlp1s0 -j MASQUERADE
# Allow forwarding dari ethernet ke WiFisudo iptables -A FORWARD -i enp0s31f6 -o wlp1s0 -j ACCEPT
# Allow return traffic dari WiFi ke ethernetsudo iptables -A FORWARD -i wlp1s0 -o enp0s31f6 -m state --state RELATED,ESTABLISHED -j ACCEPTBuka port untuk TV
# Jellyfinsudo ufw allow in on enp0s31f6 to any port 8096 proto tcp
# DHCPsudo ufw allow in on enp0s31f6 to any port 67 proto udp
# DNSsudo ufw allow in on enp0s31f6 to any port 53 proto udpSave rules permanen
sudo apt install -y iptables-persistentsudo netfilter-persistent saveAtau manual:
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:
cat /var/lib/misc/dnsmasq.leasesFormat: 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:0eArtinya 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:8096Opsi 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)
ip neigh show dev enp0s31f6Output contoh:
192.168.50.187 lladdr 4c:49:29:95:74:0e REACHABLETest 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:
ping 192.168.50.187Troubleshooting
TV tidak dapat IP
# Cek dnsmasq jalansudo systemctl status dnsmasq
# Cek logsudo journalctl -u dnsmasq -n 20
# Cek interface ethernet upip addr show enp0s31f6TV dapat IP tapi tidak bisa internet
# Cek IP forwarding aktifcat /proc/sys/net.ipv4.ip_forward# Harus return: 1
# Cek iptables rulessudo iptables -t nat -L POSTROUTING -vsudo iptables -L FORWARD -v
# Test ping dari PC ke TVping 192.168.50.187Jellyfin tidak bisa diakses
# Cek Jellyfin listen di semua interfacess -tlnp | grep 8096# Harus: 0.0.0.0:8096
# Cek firewallsudo ufw status | grep 8096Rules hilang setelah reboot
# Pastikan iptables-persistent terinstallsudo apt install -y iptables-persistent
# Save ulang rulessudo netfilter-persistent saveNetwork Topology
Internet ↓WiFi (wlp1s0) ← PC (awpetrik) → Ethernet (enp0s31f6) 10.145.168.117 192.168.50.1 ↓ DHCP + NAT ↓ Smart TV 192.168.50.187Flow:
- TV dapat IP dari DHCP server di PC
- TV akses Jellyfin di
192.168.50.1:8096 - TV internet via NAT (PC forward traffic dari ethernet ke WiFi)