Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: bridging wi-fi to ethernet, mythtv

  1. #11
    Join Date
    Sep 2010
    Beans
    11

    Re: bridging wi-fi to ethernet, mythtv

    now my routes look like this

    Code:
    root@mythbox:~# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    192.168.0.0     192.168.0.1     255.255.255.0   UG    0      0        0 wlan0
    192.168.0.0     0.0.0.0         255.255.255.0   U     2      0        0 wlan0
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
    0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
    is the second line correct? how does traffic from eth0 get to wlan0? I don't understand

  2. #12
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,835
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: bridging wi-fi to ethernet, mythtv

    I think the problem is actually a simple one -- your router. You probably need to add a static route on it to the 192.168.1.0/24 network via 192.168.0.10.

    What's happening is that wifi hosts send traffic for 192.168.1.10 (and all other addresses) to the wifi router. It doesn't have any special rule to handle that traffic, so it tries to send it out its external interface to the Internet. It needs to know that traffic for the 192.168.1.0/24 network goes to the Linux box.

    I bet you don't need that other route I suggested either.

  3. #13
    Join Date
    Sep 2010
    Beans
    11

    Re: bridging wi-fi to ethernet, mythtv

    Thank you Sensei

    Success!

    I can access my mythbackend from my laptop now. The only thing is I can't get to the internet from the ethernet on my mythbox. This doesn't matter for what I'm doing, only if I was to plug an XBox or PS3 into the ethernet port it wouldn't get to the internet.

    That's why I was going for a bridge so that traffic flowed both ways.

    I'm sure one more rule would fix that.
    Attached Images Attached Images
    Last edited by myth-eeebox-ben; September 26th, 2010 at 06:34 AM.

  4. #14
    Join Date
    Sep 2010
    Beans
    11

    Re: bridging wi-fi to ethernet, mythtv

    While I'm here, I'd better learn something about routes.

    Code:
    root@mythbox:~# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    192.168.0.0     0.0.0.0         255.255.255.0   U     2      0        0 wlan0
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
    0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
    root@mythbox:~# ping -I 192.168.1.10 192.168.0.1
    PING 192.168.0.1 (192.168.0.1) from 192.168.1.10 : 56(84) bytes of data.
    ^C
    --- 192.168.0.1 ping statistics ---
    5 packets transmitted, 0 received, 100% packet loss, time 3999ms
    so if I want to ping from eth0 to the router, I'll need to set wlan0 as my gateway right?
    so the last line says that an outside address should go through the router to the internet.
    and the second line should direct everything from the eth0 port to the wlan0 interface.
    So it needs gateway set to 192.168.0.10.

    is that right?

  5. #15
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,835
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: bridging wi-fi to ethernet, mythtv

    Let's start with a simple IP network with no routers; just a bunch of computers connected together via an old-fashioned ethernet hub. If a machine at 192.168.0.1 has a packet it needs to send to 192.168.0.2, it just "broadcasts" that packet onto the network in hopes that the .2 machine will "hear" the broadcast and accept the packet. In cases like these, there isn't any routing going on at all. Since all the machines can see each other on the same wire, they all just babble away and hope things work out. (Some services like mail and web use the Transmission Control Protocol, the "TCP" in "TCP/IP", as well to insure reliable transfers. The receiving machine acknowledges the receipt of each packet. Any that are missing are retransmitted.)

    In a routing table, this situation is represented by lines like the one for 192.168.0.0/255.255.255.0 on your machine. The Linux box knows that if it has any packets for a machine in this network, it should broadcast them on the wlan0 interface. Similarly if the eth0 interface were connected to other computers on its side via a hub, Linux would know to broadcast those packets for 192.168.1.0/24 on the eth0 interface.

    So, in your case, there really isn't any need for another "gateway" address for packets to either of the 192.168 networks. A machine in 192.168.1.0/24 would need to be configured with 192.168.1.10 as its default gateway, though, so it knows where to send traffic not destined for other machines in 192.168.1.0/24.

    Packets that don't match any specified routes are governed by the final rule which applies to all other packets. In your case the "default gateway" is your Internet router at 192.168.0.1.

    None of this explains why you can't ping from 192.168.1.10 to 192.168.0.1, though. I admit I'm stumped by that. Someday, try connecting another computer to the eth0 side using either a hub or switch or a specialized "cross-over" Ethernet cable. (Cross-over cables connect the transmit pins of one Ethernet adapter to the receive pins on the other and thus avoid the need for a hub.) Give that computer an address in 192.168.1.0/24 and tell it to ping 192.168.0.1. How does that work out?

    You'll need to fix the route you entered in the router first. It only routes to 192.168.1.10, not the entire 192.168.1.0/24 network. Try replacing the .10 with .0 and make sure everything still works. Otherwise the router will only be able to see the .10 machine and will send all other 192.168.1.x traffic to the Internet.

    Finally, you might want to install the traceroute utility as well (sudo apt-get install traceroute). Traceroute uses the same protocol as ping, but displays all the intermediate hops the packet traverses along its way. For instance, tracing a route to www.google.com from my (Linux) external router shows the following:

    Code:
    $traceroute -n www.google.com
    traceroute to www.google.com (173.194.35.104), 30 hops max, 40 byte packets
     1  xx.xxx.xx.x  3.324 ms  3.175 ms  5.482 ms
     2  130.81.49.228  5.450 ms  5.423 ms  5.377 ms
     3  130.81.29.172  5.343 ms  7.751 ms  7.735 ms
     4  152.63.16.137  14.954 ms  14.926 ms  17.438 ms
     5  152.63.16.221  17.412 ms  17.384 ms  17.336 ms
     6  152.63.21.117  67.097 ms  66.691 ms  64.081 ms
     7  152.179.72.62  14.500 ms  14.431 ms  16.815 ms
     8  216.239.43.114  16.783 ms  16.746 ms  14.627 ms
     9  216.239.48.92  16.940 ms  14.437 ms  14.343 ms
    10  173.194.35.104  14.557 ms  14.449 ms  14.392 ms
    Leaving off the "-n" option will resolve the addresses into host names; for instance, line 7 above would display with google-gw.customer.alter.net instead of 152.179.72.62.

    Traceroute can be helpful in locating a routing problem if it occurs on an intermediate router.

    Oh, and that entry for 169.254.0.0 is a kludge designed to support misconfigured Windows machines. If a Windows machine has no static IP and can't obtain an address from a DHCP server, it's assigned an address in that range by the OS. Linux distributions nowadays commonly add a route for that network automatically to avoid complaints that Linux doesn't work with Windows.
    Last edited by SeijiSensei; September 26th, 2010 at 08:08 AM.

  6. #16
    Join Date
    Sep 2010
    Beans
    11

    Re: bridging wi-fi to ethernet, mythtv

    Thanks again Sensei (you are my teacher!)

    I wasn't expecting such a detailed reply. You've outdone yourself.....

    I have connected my laptop with a crossover cable and can't ping out or get internet. That is why I have dnsmasq starting when eth0 comes up; to allow any laptop to connect and see my music, videos etc. This gives me faster transfer rates than wireless. Eeebox has gigabit lan. I only use dnsmasq as a dhcp server (because it is shipped with ubuntu and i didn't have internet when I started setting up my myth-box)

    I think I have a few things to try.

    Only one step away from calling this thread solved.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •