|
|
(2 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | [[Category:HOWTO]]
| |
− | 0.25pre {{gitcommit|8bf5157}} allows users to connect to their backend servers via IPv6
| |
| | | |
− | IPv6 use isn't mandatory.
| |
− |
| |
− | ==MythTV Setup==
| |
− |
| |
− | Interfaces typically have multiple IPv6 addresses.
| |
− | For help picking the right one, see
| |
− | [[#Which IPv6 address should be used?]].
| |
− |
| |
− | If IPv6 is known to be working, just complete the following.
| |
− | Otherwise, see [[#Prerequsites]].
| |
− |
| |
− | Stop all frontends and backends.
| |
− |
| |
− | Using <code>mythtv-setup</code> go to the General page, enter the
| |
− | address of choice in the Local Backend IP address: and in the
| |
− | Master Backend IP address: fields.
| |
− |
| |
− | The fields should look like this.
| |
− | <pre>
| |
− | Local Backend IP address: fe01:a:b:1::123
| |
− | Master Backend IP address: fe01:a:b:1::123
| |
− | </pre>
| |
− |
| |
− | Note the address isn't enclosed in <code>[brackets]</code> nor is there
| |
− | a trailing percent sign and Scope ID (<code>%eth0</code>.)
| |
− |
| |
− | Use <code>mythtv-setup</code> to configure any slave
| |
− | backends with their own IPv6 addresses.
| |
− |
| |
− | Restart the backend(s). Frontends will connect to them via IPv6
| |
− | as they're restarted.
| |
− |
| |
− | ==Which IPv6 address should be used?==
| |
− |
| |
− | Most likely, a Universal Local Address (ULA.)
| |
− | Use a ULA if all access to the backend will be
| |
− | within a LAN.
| |
− |
| |
− | Details on constructing ULAs can be found in
| |
− | [http://tools.ietf.org/html/rfc4193#section-3.2.2 RFC 4193].
| |
− | An easier read is this [http://en.wikipedia.org/wiki/Unique_local_address#Example Wiki].
| |
− |
| |
− | Hosts must have a Global (e.g. 2001:db8::1) address configured <I>only</I>
| |
− | if it is necessary for a frontend/slave located outside of the Master Backend's
| |
− | LAN to access it.
| |
− |
| |
− | Site Local (fec0::/10) addresses were deprecated in 2004.
| |
− |
| |
− | Host (::1) and Link Local (fe80::/64) addresses are not
| |
− | <B>routable</B> and shouldn't be used.
| |
− |
| |
− | To list currently assigned IPv6 addresses, type
| |
− | <code>ifconfig ethX | grep inet6</code>
| |
− | <pre>
| |
− | inet6 addr: fe80::222:22ff:fe22:2222/64 Scope:Link
| |
− | inet6 addr: fe01:a:b:1::123/64 Scope:Site
| |
− | inet6 addr: 2001:db8::123/64 Scope:Global
| |
− | </pre>
| |
− |
| |
− | In the above, the middle address is probably the best choice.
| |
− | It is also probably one that must be assigned manually.
| |
− |
| |
− | Use the configuration tool provided with the host's distribution
| |
− | to add it.
| |
− |
| |
− | An entry in /etc/hosts (DHCP, router etc.) is desirable. The following
| |
− | is an example for one host:
| |
− |
| |
− | <pre>
| |
− | 192.168.1.123 masterbe.local masterbe
| |
− | fe80::222:22ff:fe22:2222 masterbe-ll.local masterbe.ll
| |
− | fe01:a:b:1::123 masterbe.local masterbe
| |
− | 2001:db8::123 masterbe.local masterbe
| |
− | </pre>
| |
− |
| |
− | [[#MythTV Setup]]
| |
− |
| |
− | ==Prerequsites==
| |
− |
| |
− | Verify that IPv6 is active on each MythTV host.
| |
− |
| |
− | If ssh, for example, is known to work, a simple
| |
− | test (run from the Master Backend) is:
| |
− |
| |
− | <pre>
| |
− | for HOST in <list all frontend and slave backends here>
| |
− | do ssh -6 $HOST ls -l /bin/ls
| |
− | done
| |
− | </pre>
| |
− |
| |
− | If the test works for all frontends and slave backends,
| |
− | the system is ready for conversion.
| |
− |
| |
− | If the above fails, see the following section.
| |
− |
| |
− | [[#MythTV Setup]]
| |
− | ==What if there's a problem==
| |
− |
| |
− | *Make sure IPv6 hasn't been disabled either system wide or for the interface MythTV will be using:
| |
− |
| |
− | <code>sysctl -a | grep ipv6</code>. Watch for values set to 1:
| |
− | <pre>
| |
− | net.ipv6.conf.all.disable_ipv6 = 0
| |
− | net.ipv6.conf.default.disable_ipv6 = 0
| |
− | net.ipv6.conf.lo.disable_ipv6 = 0
| |
− | net.ipv6.conf.eth0.disable_ipv6 = 0
| |
− | </pre>
| |
− |
| |
− | *There is currently an issue if:
| |
− | <pre>
| |
− | net.ipv6.bindv6only = 1
| |
− | </pre>
| |
− | This can shutdown MythTV completely, before it is converted to use IPv6 addresses, as IPv4 addresses won't be able to connect to the backend {{Ticket|9820}}, {{Ticket|9840}} and {{Ticket|10165}}. A fix is being tested off-ticket/off-list.
| |
− |
| |
− | Any of the above can be controlled by changing files in <code>/etc/sysctl.d</code> in
| |
− | some distributions.
| |
− |
| |
− | If there are no files with the value(s) that need to be changed, create a file like <code>60-bindv6only.conf</code> for example, and put <code>net.ipv6.bindv6only = 0</code> in it.
| |
− |
| |
− | *Be sure any firewalls have been adjusted to accept the IPv6 addresses being used.
| |
− |
| |
− | *MySQL connections are currently selected by the information in config.xml and mysql.txt files. Unless a version of MySQL that supports IPv6 is being used, no changes are required.
| |
− |
| |
− | If there are entries in /etc/hosts (etc.), for both IPv4 and
| |
− | IPv6 addresses that have the same hostname (which is perfectly
| |
− | legal,) make sure the host's preferences pick IPv4 first.
| |
− | <code>/etc/gai.conf</code> may exist and control this.
| |
− |
| |
− | [[#MythTV Setup]]
| |
− |
| |
− | ==Tools and sample output==
| |
− |
| |
− | These examples are all from a host with <code>mythbackend</code>
| |
− | running and using IPv6. MySQL is running and using IPv4.
| |
− | Obviously, they can be run on frontends and slave backends.
| |
− |
| |
− | {{Warning box|The output of some tools and in logfiles may expose IPv6 addresses.
| |
− | Some addresses contain a modified MAC address or globally addressable IPv6 addresses.
| |
− | When posting output to a public form, consider camouflaging them.}}
| |
− |
| |
− | To make sure <code>mythbackend</code> and <code>mysqld</code>
| |
− | are listening for connections:
| |
− |
| |
− | <code>sudo netstat -pant | egrep '3306|6543'</code>
| |
− |
| |
− | When the backend is running, but no frontends are connected, expect:
| |
− | <pre>
| |
− | tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1436/mysqld
| |
− | tcp6 0 0 :::6543 :::* LISTEN 2123/mythbackend
| |
− | </pre>
| |
− |
| |
− | With a frontend connected, expect:
| |
− | <pre>
| |
− | tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1436/mysqld
| |
− | tcp 0 0 192.168.1.123:3306 192.168.1.200:33878 ESTABLISHED 1436/mysqld
| |
− | ...
| |
− | tcp6 0 0 :::6543 :::* LISTEN 2123/mythbackend
| |
− | tcp6 0 0 fe01:a:b:1::123:6543 fe01:a:b:1::456:35220 ESTABLISHED 2123/mythbackend
| |
− | tcp6 0 0 fe01:a:b:1::123:6543 fe01:a:b:1::456:35219 ESTABLISHED 2123/mythbackend
| |
− | </pre>
| |
− |
| |
− | If installed, <code>nmap</code> may help diagnose the reason
| |
− | that a connection fails. For example, a firewall
| |
− | could be blocking access.
| |
− |
| |
− | <code>nmap -P0 -p 3306,6543 -6 --reason someHostName</code>
| |
− |
| |
− | The expected response is:
| |
− | <pre>
| |
− | PORT STATE SERVICE REASON
| |
− | 3306/tcp closed mysql conn-refused
| |
− | 6543/tcp open mythtv syn-ack
| |
− | </pre>
| |
− |
| |
− | Port 3306 fails in this test, as expected, because the MySQL version
| |
− | doesn't support IPv6 (remove the -6 flag above and this will work.)
| |
− |
| |
− | As always, both <code>mythbackend</code> and <code>mythfrontend</code>
| |
− | can be started with additional logging enabled:
| |
− |
| |
− | <pre>
| |
− | <code>mythbackend --verbose general,network --nodblog --quiet \
| |
− | --logpath=/var/log/mythtv --loglevel=debug</code>
| |
− | </pre>
| |
− |
| |
− | A currently running backend's logging can be changed with:
| |
− |
| |
− | <code>mythbackend --setverbose network --quiet --nodblog</code>
| |
− |
| |
− | [[#MythTV Setup]]
| |
− |
| |
− | All addresses in this Wiki are fake. No animals were harmed in their creation.
| |