openwrt random gateway internet access

--castellano --english

pre-kurs questions:

  1. -do you know what a shell/console is?
  2. -do you know what a router is?
  3. -do you know what tcp-ip means?
  4. -192.168.1.1 does this number means anything to you?
  5. -do you know how wi-fi works?
  6. -are you a windows/mac/linux user?

pre-kurs highlight This workshop does aim to let you understand only some basic topics and commands in order of being able to connect to the internet thanks to the linux-modified software of the linksys wrt54g router. You are not gonna be able to manage a linux system after it, but you are hopefully gonna be able to have the basic informations about connecting to and using the openwrt software. And, hopefully, thanx to the problems you are gonna face in this process, you'll be interested in knowing more about GNU/linux, a first step into abandoning microsoft windows. Linux manteinance is nothing for e-mail users, you will need time and goodwill to understand and use it, so do not panic if you're not gonna understand anything at the beginning, also if you still not understand anything after 4 weeks. Linux manteinance is something that you can both learn alone and sharing knowledge and problems with other linux users around you...


-wireless:

channels 1-13
essid
WEP encription
WPA encription
--> iwconfig

-network:

ifconfig
gateway
route
--> ifconfig

-interfaces:

eth1
br0


-programs:

masquerading (script)
wl
kismet


1- networking

-tcp/ip:

interfaces
eth0, openwrt's eth1 br0
numbers
ip,gateway,(subnetmask,broadcast)
dns
ping
route
nmap
ssh
-others

ls
df
vi

2- wi-fi connections

3- openwrt

flashing
hardware (open and see)
positioning
ethernet cables

1- NETWORKING

TCP-IP

TCP-IP
The network protocol used by computers to communicate. It is made by an ADRESS written in numbers, from 0.0.0.0 to 255.255.255.255
IP adress: The direction of your compuiter (ex. 192.168.1.8)
gateway
The adress of a machine where your connection is passing through (ex. a ROUTER, ex. 192.168.1.1), and which redistributes the traffic to other machines after and before itself.
netmask
needed by the tcp-ip protocol, usually it's 255.255.255.0
broadcast
the general adress of your internal network (ex 192.168.1.0 if your ip address is 192.168.1.8 and your gateway is 192.168.1.1)

ROUTE
A route is a kind of road your traffic has to follow in order to be able to connect to a machine (in our case a router). Thanks to the route command, you can specify a GATEWAY for your traffic. Usula route command is : route add default gw 192.168.1.1 eth1 , in which you say to add the machine number 192.168.1.1 as a default gateway to the hardware interface eth1. If you have to delete a route, the command will be the same (ex. route del defaulkt gw 192.168.1.1 eth1). By tipping symply: route , you will have an overlook to the current route settings.

DNS
Domain Name Server: adress of a machine which translates IPadresses (ex. 192.168.1.77) to Domain Names (ex. cyberforat.squat.net). If your DNS is not set correctly, then your computer will be unable to undestand Domain Names, but will relay on ip adresses. (ex. 141.20.1.3 is www.???). Usually the Primary DNS is your wrt54g, or the router where you connect to the internet from (ex. 192.168.1.1). Useful DNS in Barcelona are: 80.58.32.97, 194.224.52.37, 62.81.16.197, 80.58.32.97 - 194.224.52.37 - 62.81.16.197 . You can edit the DNS you relay to by editing the resolv.conf file (vi /etc/resolv.conf)

PING
The ping command is the easiest way to understand if you are able to connect to a machine. You send a packet to a machine, and this answers to your machine. You can both ping an IPadress or a Domain Name. Ping your router to undestand if everything is allright (ping 192.168.?.?). Ping the router you connect to to understand if you established a wireless connection (ex. ping 192.168.1.1). Ping an internet IPadress to understand if you have a working connection to the internet (ex ping 141.20.1.3 (the adress of humbolt university in germany)). ping a DomainName to understand if your DNS settings are ok (ex. ping google.com).

SSH
Secure shell, an encrypted way to communicate to another machine. Using: ssh root@192.168.1.8 , you will be able to open a root-console on that machine,that means haveing the complete control on a linux syatem. We use it to communicate from our computer to the router. For windows user, useful is putty.exe (google.com download putty.exe), which will opens remote linux-console from a windows machine.

USEFUL COMMANDS
ssh root@192.168.?.?
ifconfig eth1 192.168.1.1
route add default gateway 192.168.1.1 eth1
ping 141.20.1.3
vi /etc/resolv.conf


links:
http://openwrt.org --openwrt how to
http://grepgrrl.poivron.org --linux how to's
http://valenciawireless.org --wireless/openwrt help castellano
http://seattlewireless.org --wireless/openwrt help english
http://debian.org --debian, the linux distribution we love
http://wikipedia.org --everybody can edit this enciclopedia

prepare the openwrt:
flash
install dropbear, wl, kismet
disable telnet
set br0, eth1 and default gw for br0
masquerading as script
wl scan ; sleep 3 ; wl scanresults as script

openwrt random gateway internet access


once we succesfully flashed the wrt:-----

NVRAM SETTINGS

typing
nvram show, you will get a list of the settings of the nvram of your WRT, which means the core configuration that will work when you plug in your router. typing: nvram show | more, you will be able to see it a bit more easely.

There are some default settings that we want to change, in order to be able to have two separate networks: one for the wireless antenna and one for the ethernet ports.

-- OtmMto - 01 Apr 2005