Lintrack As A LAN Gateway And An OpenVPN Bridge
|
Submitted by pjf (Contact Author) (Forums) on Wed, 2007-05-09 18:16. :: Linux | Control Panels | DNS
Lintrack As A LAN Gateway And An OpenVPN BridgeThis tutorial will guide you through installation and configuration of Lintrack, a GNU/Linux distribution specialized in networking tasks. We will give two LANs access to the internet along with DHCP and DNS cache servers, and then we will connect our networks using OpenVPN in bridging mode. You should be running all these in well under an hour, thanks to the unified configuration interface of Lintrack. The PlanThe diagram below presents the network we are about to create.
Hosts rt1 and rt2 are our routers running Lintrack. Both of them have Internet connection (e.g. via DSL modems), a public IP address available on eth0 interface and a Local Area Network behind. You will need two x86 hosts (a typical PC should be good enough), with at least 128MB of RAM and 256MB of storage space (can be a Compact Flash card), some Fast/Gigabit Ethernet cards and, if you wish, WiFi cards based on Atheros chipsets, e.g. on popular AR5213. If you're going to install Lintrack on VMware, be sure to use an IDE disk instead of default SCSI one. If you prefer qemu, please test running it with and without kqemu enabled in case of problems. Installation
Basic NetworkingFirst, we will configure Internet access and basic services for local network, so login as root using password "asn". Lintrack is configured by fcc tool, so let's start it on host rt1 and do some basic configuration: fcc Hint: you may try Tab autocompletion (like in Bash), to make typing the commands easier. Now, we add and configure eth0 interface: cd / net if eth The LAN bridge: cd .. Default route and DNS server (replace dns.server.ip.address with proper IP address): cd / net The firewall with two zones - "internet": cd fw ...and "lan": cd .. Finally - we enable dnsmasq as DNS cache and DHCP server: cd / srv dnsmasq Now do the same steps on rt2, replacing host name, IP addresses and DHCP address range (e.g. from 192.168.1.151 to 192.168.1.250). Note that fcc operates on something like a configuration file - this means the changes made won't be applied immediately. However, we will manually enable basic networking in order to be able to login via SSH e.g. from some more comfortable graphical terminal with clipboard functionality. Exit from fcc by pressing Ctrl+D or typing quit and do the following on both hosts: cd /etc/rc.d This should give you access to both machines from Internet and wired LAN. Wireless AccessNow we'll add a WiFi access point with WPA2-PSK security. Skip to next section if you don't wish to give your users wireless Internet. As usual, start fcc on rt1 or rt2 (or both), and type the following commands: cd / net if ath Note that the output of "act list" command does not immediately take into account changes made to card's country code, radio mode (a/b/g), etc. The simplest solution is to reboot after making such low-level changes in order to let the madwifi driver load with new settings. Now, we have a physical radio configured, so let's create a real network interface on top of it: add +if ath0 And to secure it, we enable WPA2-PSK: cd wpa Finally, let's add ath0 to local bridge br0 to let WiFi users talk to Ethernet ones. cd / net if br br0 Adding OpenVPNFinally, let's connect both LANs with OpenVPN. Make rt1 the OpenVPN server: cd / net if openvpn Copy the static OpenVPN key to clipboard and do the similar commands on rt2: cd / net if openvpn Last command starts vim, a file editor. It is worth learning how to use it, but for now just press 'a', paste the copied key, press Escape, write ':wq' and press Enter. You may change the file editor by exporting $EDITOR environmental variable before starting fcc, e.g. set it to mcedit. In case you don't have a graphical terminal, use scp to copy file /etc/fc/net/if/openvpn/tap0/statickey from rt1 to rt2. Add tap0 to local bridges - on both hosts do: cd / net if br br0 Reboot and that's it ;-). In case you have problems with OpenVPN, you may always restart it in debugging mode from shell using: /etc/rc.d/rc.openvpn tap0 restart debug Going FurtherAfter verying that everything works properly, it's definitely a good idea to change the root password (use passwd command) and update the system: pkg update You may find more information about Lintrack on it's website - http://www.lintrack.org/. Don't miss our wiki, forum, Trac and especially a more in-depth introductory article on the great PolishLinux.org vortal.
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com








Recent comments
18 hours 10 min ago
19 hours 38 min ago
23 hours 13 min ago
1 day 2 hours ago
1 day 5 hours ago
1 day 5 hours ago
1 day 5 hours ago
1 day 6 hours ago
1 day 8 hours ago
1 day 8 hours ago