Skip to content

markv9401/diyrouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

DIY Linux IPV4 + IPV6 router

There were a bit too many tutorials on DIY Linux routers (ArsTechnica, Arch -, Gentoo -, Ubuntu wiki etc.), yet none on its own helped me create my own implementation. It was the joint forces of all above listed and further random forums, reddit etc. So I thought I'd share my own configurations and applications I used to make it easier for others and to keep my notes for later use.

Tools in use

Have these installed or get ready to replace them on your own.

  • systemd
  • systemctl
  • netctl
  • dnsmasq
  • iptables
  • wide-dhcpv6

Configurations

netctl

working dir: /etc/netctl

Choose a sample config from the netctl configs that best describes your WAN setup:

  • PPPoE ~ wan_pppoe
  • DHCP ~ wan_dhcp

and edit your WAN interface and access data. IMPORTANT: if you choose PPPoE then your WAN INTERFACE will be ppp0 from now on excluding the wan_pppoe config file.

Choose one for the LAN setup too:

  • Single LAN port ~ lan_single
  • Multiple LAN port (dual/quadro NICs) ~ lan_bridge

IMPORTANT: if you choose BRIDGE MODE then your LAN INTERFACE will be br0 (or what you name it in the config) from now on excluding the lan_bridge config file.

dnsmasq

config: /etc/dnsmasq.conf

Simply replace LANIF with your previously configured lan interface on all 3 occurences.

iptables

working dir: /etc/iptables

Replace all instances of WANIF and LANIF in iptables.rules

wide-dhcpv6

config: /etc/wide-dhcpv6/dhcp6c.conf

Replace all WANIF and LANIF with your interfaces' names.

Enabling services

Use your choice of wan / lan profiles' names!

systemctl enable netctl
netctl enable wan_XXXX
netctl enable lan_XXXX

systemctl enable dnsmasq

systemctl enable iptables
systemctl enable ip6tables

Starting services

Either simply reboot

or

Use your choice of wan / lan profiles' names!

netctl start lan_XXXX
netctl start wan_XXXX

systemctl start dnsmasq

iptables-restore < /etc/iptables/iptables.rules
ip6tables-restore < /etc/iptables/ip6tables.rules

About

Router implementation for home

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published