Author Topic: The Linux ADSL / WiFi Router ...  (Read 4608 times)

0 Members and 1 Guest are viewing this topic.

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1420
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
The Linux ADSL / WiFi Router ...
« on: October 27, 2011, 04:12:06 pm »
I've been using various routers for WiFi and ADSL for years and they've sort of been Ok, but recently my Thompson Speedtouch Router seems to've been having all manner of problems, and neither replacing the router or upgrading the BIOS seem to have had any effect. So, what about just using a Linux PC?

Here's what you need;

a. Linux PC running Ubuntu 11.10
b. One of these for ADSL (http://linitx.com/product/12181)
c. An ASUS PCE-N13 802.11 b/g/n or similar for WiFi

To make it run, add the bridge utils package and the hostapd package.

Your /etc/network/interfaces file will need to look like this;

Code: [Select]
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
metric 0

auto eth1
iface eth1 inet manual
metric 0

auto wlan0
iface wlan0 inet manual
metric 0

auto br0
iface br0 inet dhcp
        bridge_ports eth0 eth1 wlan0
        bridge_fd 0
        bridge_stp off
        metric 1

Then you will need to create a hostapd configuration in /etc/hostapd/hostapd.conf like this;

Code: [Select]
# Access Point Definition
interface=wlan0
ssid=<your SSID>
channel=1
driver=nl80211
country_code=UK
ieee80211d=1
hw_mode=g
beacon_int=100
dtim_period=2
max_num_sta=255
auth_algs=2
wep_default_key=0
wep_key0=0123450000

And modify your /etc/default/hostapd so that it starts;

Code: [Select]
DAEMON_CONF="/etc/hostapd/hostapd.conf"
DAEMON_OPTS="-tK"

If you reboot your machine, all you need to do is configure your ADSL and you're off. So point your browser at 192.168.0.2, password "admin" then enter your ADSL username, password, VPI=0, VCI=34 and Encapsulation=PPoa/VcMUX .. and you should be good to go.

.. I plugged this up here this morning, works fine, although I might get a larger Ariel for the WiFi card. If anything it seems quicker and smoother that my Speedtouch ever was. This is what I'm getting from the ADSL stats page;



Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18210
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: The Linux ADSL / WiFi Router ...
« Reply #1 on: October 27, 2011, 05:06:33 pm »
Don't you need some iptable rules to take care of Network Address Translation, firewall, and inbound connections such as SSH etc. ?

Any reason you didn't go for Smoothwall, Redwall, etc ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1420
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: The Linux ADSL / WiFi Router ...
« Reply #2 on: October 27, 2011, 09:00:24 pm »
>Don't you need some iptable rules to take care of Network Address Translation, firewall, and inbound connections such as SSH etc.

Nope.

>Any reason you didn't go for Smoothwall, Redwall, etc ?

Not needed.

The ADSL PCI card is actually a router on a card, so it does NAT, DMZ's etc, all available via a browser.
You "can" add firewall stuff if you need it, but generally the NAT on the card will handle it.
(I'm sure "I" will add some eventually, but generally it'll work securely as-is in most instances)

The beauty of this solution is that the card presents as a standard network interface, so there are no flakey ADSL drivers to worry about.
Once you bridge your WiFi nic, Local nic and ADSL card, essentially you have one network which is all "inside" the ADSL router's NAT, *and* the entire network (wired and wireless) feeds off the DHCP server that sits on the ADSL card.

:)

If I stuck a dedicated router distro on there, I wouldn't be able to use my Ubuntu desktop ... ;)

It's now 9pm, probably peak time .. I have 10 active VPN connections running and 10 remote gkrellm sessions running over the ADSL.
This is a 30 packet ping against linux.co.uk;

Code: [Select]
--- linux.co.uk ping statistics ---
30 packets transmitted, 30 received, 0% packet loss, time 29042ms
rtt min/avg/max/mdev = 21.847/22.245/22.829/0.321 ms

Not only is it quick, but note the consistency!

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18210
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: The Linux ADSL / WiFi Router ...
« Reply #3 on: October 27, 2011, 09:20:54 pm »
Mmm .. impressive, and interesting :) .. I  had meant to chuck that in as a question .. whether it was a dedicated box, or if it was still a usable desktop .. now I know, the Smoothwall question is obviously redundant.

Certainly worth bearing in mind ..

Oooo .. that sounds handy .. slightly off topic, but any chance of explaining how to set up a remote GKrellM session ?
« Last Edit: October 27, 2011, 09:39:04 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1420
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: The Linux ADSL / WiFi Router ...
« Reply #4 on: October 28, 2011, 02:26:20 am »
Yup, on the server;

Code: [Select]
apt-get install gkrellmd
edit /etc/gkrellmd.conf
make sure you have allow-host set to let you in (!)
read the notes and adjust accordingly, for WAN links I recommend update-hz 1

On the client;

Code: [Select]
apt-get install gkrellm
gkrellm -s <remote host ip>

Owzat?

If you grab the extended themes, set your theme to be "CoplandOS", width 100, 2 Krell updates per sec.
Set remember location and don't show in pager or taskbar.
I also turn down the font size and change the face to verdana ...


 


SimplePortal 2.3.3 © 2008-2010, SimplePortal