![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Server Platforms Discussion regarding any server based ubuntu release. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: May 2006
Location: colorado
Beans: 34
Ubuntu 7.04 Feisty Fawn
|
Update: this is now working.
It looks like my issue with bridging was and is a hardware issue. The Atheros card will not come on-line after a reboot, but will come up on a hard power cycle. My first How To, and it is kind of long. Basically I was sick of my Linksys router being to slow and I decided I wanted some more power. This took a long time to work through and get running. Hopefully I got it all. First off you will need a spare machine, some NICs and a lot of patience. Also a working knowledge of nano and the console would be nice. My Hardware Specs: Old Micron Desktop Computer with everything onboard/built in Celeron 400 MHZ 384mb RAM 40GB HDD Atheros based cheap wireless NIC from Compusa 2 Realtek 10/100 NICs I chose the Atheros card because it was laying around in storage gathering dust. I also have a nice 10db antenna that hooks up to it. For comments or complaints email me. pedalwrench007 at gmail dot com Here goes and have fun: GOAL To have a seamless replacement for my Linksys WRT54G with more wireless range and more control. INITIAL Install the basic Ubuntu Server [NO DNS or LAMP] Enable the Universe Repo apt-get update Since this is a long How to you should just be root to config the server. type the command: Code:
sudo su - SETUP THE NETWORK 3 interface setup my eth0 is broken and on-board so I had to add a card [YMMV] eth1 is the WAN interface (gateway) eth2 is the LAN interface ath0 is the wireless card br0 is the bridged connection of ath0 and eth2 Setup bridging Code:
apt-get install bridge-utils Code:
nano /etc/network/interfaces Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
#MY BROKEN INTERFACE (3com on-board)
#auto eth0
#iface eth0 inet dhcp
#pre-up iptables-restore < /etc/iptables.conf
# Gateway
# You should set this to DHCP if your cable/DSL ISP provides it.
# the "pre-up" command brings up the iptables "firewall"
# it is just set to static for testing purposes. see eth0 for DHCP setup.
auto eth1
iface eth1 inet static
address 192.168.1.17
netmask 255.255.255.0
gateway 192.168.1.1
pre-up iptables-restore < /etc/iptables.conf
#Wireless Setup
auto ath0
iface ath0 inet manual
wireless-mode master
# CHANGE ME!!! to your own ESSID
wireless-essid pivotpoint
#Bridge interface
auto br0
iface br0 inet static
address 10.1.1.1
network 10.1.1.0
netmask 255.255.255.0
broadcast 10.1.1.255
bridge-ports eth2 ath0
Atheros card setup for routing [resource = https://help.ubuntu.com/community/Router/Madwifi] You have to install the Source to get the driver into Master mode for a WAP Code:
wget http://umn.dl.sourceforge.net/sourceforge/madwifi/madwifi-0.9.2.1.tar.gz tar -xvzf madwifi-0.9.2.1.tar.gz cd madwifi-0.9.2.1 apt-get install build-essential linux-headers-server make make install Code:
nano /etc/modprobe.d/madwifi Code:
options ath_pci autocreate=ap run these commands: [resource = https://help.ubuntu.com/6.10/ubuntu/...iguration.html ] [NOTE: ETH1 is the gateway interface. YMMV] Code:
iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -o eth1 -j MASQUERADE iptables -A FORWARD -s 10.1.1.0/24 -o eth1 -j ACCEPT iptables -A FORWARD -d 10.1.1.0/24 -m state --state ESTABLISHED,RELATED -i eth1 -j ACCEPT Code:
iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j LOG --log-prefix "NEW_HTTP_CONN: " save to /etc/iptables.conf Code:
iptables-save > /etc/iptables.conf ng to protect your machine. # Enable packet forwarding in the Kernel Code:
nano /etc/sysctl.conf Code:
net.ipv4.conf.forwarding=1 NOTE: Ubuntu has this for default: #net.ipv4.conf.default.forwarding=1 Make sure you remove the word "default." there is no need for it DHCP SERVER SETUP A basic 10 machine DHCP server. Nothin' fancy Install DHCP server: Code:
apt-get install dhcpd Code:
nano /etc/dhcpd.conf Code:
# MY BASIC CONFIG /etc/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
#CHANGE THIS TO YOUR DNS SERVERS
option domain-name-servers 68.87.69.146, 67.87.85.98;
option domain-name "youdomainnamehere.com";
#Subnet for DHCP Clients
subnet 10.1.1.0 netmask 255.255.255.0 {
# range of 10 machines
range 10.1.1.50 10.1.1.60;
option subnet-mask 255.255.255.0;
option broadcast-address 10.1.1.255;
option routers 10.1.1.1;
}
should listen to. By default it listens to eth0. We need to only have it listen to our local NIC {br0} Code:
nano /etc/default/dhcp Code:
INTERFACES="br0" Darkstat Stats with a http server Code:
apt-get install darkstat Code:
nano /etc/darkstat/init.cfg Code:
# Turn this to yes when you have configured the options below. START_DARKSTAT=yes # Don't forget to read the man page. # You must set this option, else darkstat may not listen to # the interface you want INTERFACE="-i eth1" PORT="-p 8888" #BINDIP="-b 127.0.0.1" #LOCAL="-l 10.1.1.0/24" #FIP="-f 127.0.0.1" #DNS="-n" #SPY="--spy eth1" Saidar a neat little ap that shows server usage Code:
apt-get install saidar Code:
saidar Disabling IPv6 for some speed improvments Code:
nano /etc/modprobe.d/aliases Code:
alias net-pf-10 ipv6 Code:
nano /etc/modprobe.d/blacklist Code:
blacklist ipv6 FINISH restart your computer. Hopefully everything worked. If so, back it up! BACKUP [Reference = http://doc.gwos.org/index.php/Backup_restore_system ] Code:
sudo su - cd / tar cvpjf backup.tar.bz2 --exclude=/proc --exclude=/media --exclude=/mnt --exclude=/dev --exclude=/lost+found --exclude=/backup.tar.bz2 --exclude=/tmp --exclude=/sys / Store in a cool dry place. FUTURE GOALS Add Squid, and DNS-Masq. Add Port Forwarding References: https://help.ubuntu.com/community/Br...workInterfaces https://help.ubuntu.com/community/Ub...lessRouter/New http://www.netfilter.org/documentati...ing-HOWTO.html http://www.debianadmin.com/monitor-y...th-saidar.html https://help.ubuntu.com/6.10/ubuntu/...e/C/index.html http://www.debianadmin.com/network-t...tu-system.html VERSION: 0.1 3-11-2007 - Re-Write. Setup is a little different. Changed firewall config, deleted squid, and dns-masq. 0.0 3-4-2007 - Initial write-up Last edited by pedalwrench; March 11th, 2007 at 04:53 PM.. Reason: Spell Check |
|
|
|
|
|
#2 |
|
Ubuntu Extra Shot
![]() Join Date: Oct 2006
Beans: 393
|
Re: HOWTO: Setup Ubuntu as a wireless router
Good work! Looks promising!
__________________
MS gonna get ya
|
|
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() Join Date: Apr 2005
Location: Philladelphia, PA
Beans: 56
Ubuntu 9.04 Jaunty Jackalope
|
Re: HOWTO: Setup Ubuntu as a wireless router
Cool! I just reinstalled Edgy (reverted back to i386) and need to provide some type of network access, much like you describe here. I wanted to know why you chose bridging, instead of routing? Besides the actual data "routing", are there any key differences between bridging and routing?
Thanks for any thoughts! |
|
|
|
|
|
#4 | |
|
5 Cups of Ubuntu
![]() Join Date: May 2006
Location: colorado
Beans: 34
Ubuntu 7.04 Feisty Fawn
|
Re: HOWTO: Setup Ubuntu as a wireless router
Quote:
Well, I just thought that would be the best way to make it look seamless, like a linksys or d-link router. That is a great idea though. I may drop the bridging and go that route. The madwifi driver and wireless-tools doesn't seem to work well together with bridge-utils. Unless I am missing something. For routing with out the bridge it should be pretty simple. just set the network up with separate interfaces, point dhcp and dns-masq to those interfaces, and then reconfig the firewall accordingly. It actually works that way. |
|
|
|
|
|
|
#5 |
|
5 Cups of Ubuntu
![]() Join Date: Sep 2006
Beans: 23
|
Re: HOWTO: Setup Ubuntu as a wireless router
You probably should also note that it is of CRITICAL importance that you have a Wireless NIC that supports MASTER MODE.
|
|
|
|
|
|
#6 | |
|
5 Cups of Ubuntu
![]() Join Date: May 2006
Location: colorado
Beans: 34
Ubuntu 7.04 Feisty Fawn
|
Re: HOWTO: Setup Ubuntu as a wireless router
Quote:
I have to build the Madwifi driver from source to get it going. |
|
|
|
|
|
|
#7 |
|
First Cup of Ubuntu
![]() Join Date: Jun 2006
Beans: 3
|
Re: HOWTO: Setup Ubuntu as a wireless router
Isn't it better to sudo -s instead of sudo su - ?
|
|
|
|
|
|
#8 |
|
Just Give Me the Beans!
![]() |
Re: HOWTO: Setup Ubuntu as a wireless router
Some suggestions:
Instead of manipulating iptables directly, consider using shorewall (http://shorewall.net) it makes configuring iptables much easier and also enables creating "trusted" and "untrusted" zones pretty easily. Also doing NAT/masquerade and port forwarding is also easy. Second, instead of installing a dhcp server, consider using the dnsmasq package. It's both a DHCP server and a DNS cache and works rather nicely on my Ubuntu software router (I notice you put it in the future plans, though). For easy web administration, I use webmin (http://webmin.com). It's not in the Ubuntu repository but you can find a binary package on their web page. You can configure a lot of settings like that, including shorewall.
__________________
"Violence is the last refuge of the incompetent." - Salvor Hardin in Foundation by I. Asimov My blog | My CC-licensed novel | Plasma FAQ maintainer |
|
|
|
|
|
#9 |
|
Way Too Much Ubuntu
![]() Join Date: Jan 2005
Beans: 210
|
Re: HOWTO: Setup Ubuntu as a wireless router
To become root you only need to type "sudo -s"
And running a PC 24/7 will cost you 10 times as much as a wireless router, as far as the electricity bill. |
|
|
|
|
|
#10 |
|
First Cup of Ubuntu
![]() Join Date: Jan 2005
Beans: 5
|
Re: HOWTO: Setup Ubuntu as a wireless router
Very nice work!
I see you are thinking about some future additions to this article. A couple that I would like to suggest are: Squid/dansguardian- So that if it was an open network no one could use it for illegal porn. bandwidth control, total and for each individual connection- So no one could saturate your bandwidth with bittorent homepage redirect- So people could see my shiny new site first. I think this could be done with squid. I know that "Open wireless network" is a much maligned term. If secured properly, their usefulness is too good to be ignored. Thank you |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|