blog/source/_posts/2014-02-08-internet-sharing-ipv4-and-ipv6-on-archlinux-using-dnsmasq.markdown

44 lines
1.6 KiB
Markdown
Raw Normal View History

2014-02-08 19:35:02 +00:00
---
layout: post
title: "Internet sharing (ipv4 and ipv6) on archlinux using dnsmasq"
date: 2014-02-08 20:02:22 +0100
comments: true
categories:
- arch
- dhcp
- ipv6 router advertisement
---
A guide to connect with a different machine using a ethernet cable for
internet sharing or just transferring files:
1. Install dnsmasq and iproute2
$ pacman -S dnsmasq iproute2
2. Copy over the configuration files at the end of the article and edit the
*/etc/conf.d/share-internet* to match your network setup.
3. Start the sharing service with systemd
$ sudo systemctl start internet-sharing.service
After that the other machine can connect via dhcp. It will get an ipv4
address from the **10.20.0.0/24** subnet and a ipv6 address from the **fd21:30c2:dd2f::**
subnet. Your host will be reachable via **10.20.0.1** or **fd21:30c2:dd2f::1**.
Thanks to ipv6 router advertising, an AAAA record for each host is automatically set based on the hostname.
This means if your hostname is *foo*, all members of the network can just connect
to it using the address *foo*. You should disable the share-internet.service, if
you don't need it. Otherwise you might mess up network setups, if you connect to a
network with the device on which the dhcp service is running.
Happy networking!
{% include_code /etc/conf.d/share-internet lang:bash share-internet/share-internet %}
{% include_code /etc/systemd/system/share-internet.service lang:ini share-internet/share-internet.service %}
{% include_code /etc/dnsmasq.conf lang:ini share-internet/dnsmasq.conf %}
{% include_code /etc/dnsmasq.conf.dhcp lang:bash share-internet/dnsmasq.conf.dhcp %}