You are not logged in.

#1 2019-01-09 12:12:30

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,930
Website

Linux pc > Philips tv

So I got the 2nd Ethernet card on the pc and connected to the tv directly (I'd like some dlna action eventually), how to setup the card/connetions and stuff ... ? (I'am pretty pathetic when it comes to networking ...).

So far I tried setting the specific connection on pc to have manual ip4 address, also DHCP, but not sure how is that even supposed to work since tv has manual ip grayed out in settings ...

Any hints on what should I read appreciated.

Inxi

Network:   Card-1: Intel 82578DM Gigabit Network Connection driver: e1000e
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 6c:62:6d:68:ac:8f
           Card-2: Intel 82575EB Gigabit Network Connection driver: igb
           IF: ens1f0 state: down mac: 00:25:90:97:bb:e6
           Card-3: Intel 82575EB Gigabit Network Connection driver: igb
           IF: ens1f1 state: down mac: 00:25:90:97:bb:e7

Last edited by brontosaurusrex (2019-01-09 12:26:08)

Offline

#2 2019-01-09 14:13:15

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 649

Re: Linux pc > Philips tv

Consider a TV as another computer in your lan. This means that connecting your actual computer to your TV with single ethernet cable corresponds to two computer connected (directly) via ethernet cable. It means, you would have to configure both pc and tv on single network (via eth0), for example:
- computer IP = 192.168.5.1
- tv IP = 192.168.5.2
and set subnet masks on both devices. Forget about DNS. And you have no WAN internet connection. All this is considered unusual setup.

Much more usual setup is actually: connect both pc and tv to router, like you would connect two computers to your router. Then you can have usual ('expected') functionality of both computer(s) and TV. In fact, now you can use DHCP on your TV. And basically, this is the way to go if you want dlna ...

Personally, I just got the very same idea few days ago: to set up RPi2 as a media server with dlna (i.e. UPnP) capabilities. I suggest reading this:
- Kodi media center - you have to configure all by yourself
- LibreELEC - preconfigured Kodi, images even for RPi, fork of OpenELEC
- OpenELEC - preconfigured Kodi, images even for RPi
Probably, there is more ...

So far, I'm only at the beginning of my journey (got stuck on defective SDcards, must get a new one), and as yet cannot make educated advice.

Last edited by iMBeCil (2019-01-09 14:14:23)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#3 2019-01-09 14:45:46

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,930
Website

Re: Linux pc > Philips tv

iMBeCil, Thanks.
- The idea about direct connection is to disallow tv to do stupid stuff on network (I guess I could use some router and connect the two still)
- I used minidnla in the past, so that part should work

Last edited by brontosaurusrex (2019-01-09 14:58:24)

Offline

#4 2019-01-09 14:53:22

earlybird
ほやほや
Registered: 2015-12-16
Posts: 736
Website

Re: Linux pc > Philips tv

brontosaurusrex wrote:

So I got the 2nd Ethernet card on the pc and connected to the tv directly (I'd like some dlna action eventually), how to setup the card/connetions and stuff ... ? (I'am pretty pathetic when it comes to networking ...).

So far I tried setting the specific connection on pc to have manual ip4 address, also DHCP, but not sure how is that even supposed to work since tv has manual ip grayed out in settings ...

Any hints on what should I read appreciated.

Inxi

Network:   Card-1: Intel 82578DM Gigabit Network Connection driver: e1000e
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 6c:62:6d:68:ac:8f
           Card-2: Intel 82575EB Gigabit Network Connection driver: igb
           IF: ens1f0 state: down mac: 00:25:90:97:bb:e6
           Card-3: Intel 82575EB Gigabit Network Connection driver: igb
           IF: ens1f1 state: down mac: 00:25:90:97:bb:e7

Decide which of the interfaces the TV is connected to. Then, do

ip link set $iface up

Check if the manual settings on the TV side are still greyed out - now the TV should see the link as up (is there a setting for that?) and may allow you to configure stuff there.

Obviously, DHCP would be preferable - how did you configure that? You'd need to put a DHCP server on the $iface connected to the TV configured to allocate from a range of IP addresses. I recommend dnsmasq. Assuming you'd use the 10.180.0.0/16 network, you could put 10.180.1.1/16 on $iface, "reserve" 10.180.1.x/16 for manual allocation (like the interface) and 10.180.2.x and above for the DHCP pool. Then your TV leases a 10.180.2.x address and courtesy of dnsmasq, you'll also be able to ping it by name since its DNS integrates with DHCP.

Si mpler would be putting the TV on the same home network as your computer (via eth0) via bridging. For example, we'd create a bridge and add your computer's main interface and the TV interface to it.

ip link add br0 type bridge
ip link set eth0 master br0
ip link set ens1f0 master br0
ip link set br0 up
ip link set ens1f0 up

Then,  you'd need to release your current computer's IP address and put one on the bridge

dhclient -r eth0
dhclient br0

this will make your computer reachable again. The TV should then get its DHCP-configured IP address from your home router just as your PC.

I think in NetworkManager, you can replicate this via the connection editor (I've got GNOME on Ubuntu 16.04 here) via (+) → Bridge → Add the interfaces to "Bridged connections", set forward delay to 5 seconds, select DHCP in IPv4 Settings.

If you have a firewall configured, you need to obviously allow it to pass all traffic.

Offline

#5 2019-01-09 14:59:53

earlybird
ほやほや
Registered: 2015-12-16
Posts: 736
Website

Re: Linux pc > Philips tv

Ah, saw your edit. Well if you want your TV away from your main network, then you could use NAT as you planned in the first place (DHCP subnet is another subnet than the one used for internet access) but you can also configure a firewall on your PC that filters the bridged traffic from your TV and allows it only to pass traffic to the gateway. In order for this to fork, you need to ensure that the kernel module br_netfilter is loaded, the sysctl settings

net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

are set as described. Then, you'll be able to filter the TV traffic in the FORWARD iptables chain using matches like

iptables -A FORWARD -m physdev --physdev-in $the_tv_interface ! -d $your_gateways_address -j REJECT # let the TV only talk to your gateway
ip6tables -A FORWARD -m physdev --physdev-in $the_tv_interface -j REJECT # Don't allow the TV to do IPv6

It's a 'transparent firewall'. Don't quote me on the above rules though.

Offline

#6 2019-01-09 16:16:22

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 649

Re: Linux pc > Philips tv

^Yes, if the brontosaurusrex's plan is to use computer to connect to router with WAN via one link (for example WiFi), and then use another link (for example wired eth0) on computer to connect to TV without access to WAN, then it is enough to configure pc with firewall.

Of course, give eth0 different subnet, and configure TV directly with fixed IP (and subnet). I think all reasonable modern TVs has option to configure fixed IP on their LAN.


Postpone all your duties; if you die, you won't have to do them ..

Offline

#7 2019-01-09 22:15:27

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,930
Website

Re: Linux pc > Philips tv

@earlybird, Thanks, this will come handy (When I get magically smarter one day). For the moment, may I assume that my easiest way is to find&drop some router between the two?

Offline

#8 2019-01-10 09:06:09

earlybird
ほやほや
Registered: 2015-12-16
Posts: 736
Website

Re: Linux pc > Philips tv

brontosaurusrex wrote:

@earlybird, Thanks, this will come handy (When I get magically smarter one day). For the moment, may I assume that my easiest way is to find&drop some router between the two?

Yes, however keep an eye on the gateway. If both routers advertise DHCP to your computer, esp. cheap routers do not allow to configure DHCP regarding gateway and behave wrongly in that they always advertise a default route despite having no way to the internet, and if your computer already knows a default route to the internet from your main router and gets another default route from the other router, it shouldn't accept that one.

Offline

Board footer

Powered by FluxBB