I would like to configure my wlan0 so it would work with my router which is using WPA2 encription, and i would like my adress to be static not to interfere with other computers on the network. I removed Network manager and Wicd as i don't like them and would also like to learn a bit more about how to set up a network connection myself.
Soo i started searching the web and came across many threads talking about how to reconfigure file /etc/network/interfaces. From my past experiences i connected to the router by typing 192.168.1.1 into browser adress bar and logged into my router settings panel, where i checked how two things are set:
- router IP adress: 192.168.1.1
- subnet mask: 255.255.255.0 (type C)
I looked even further into the problem and figured out that i can calculate my network IP by doing a logic "bitwise and" operation between router IP adress and subnet mask above.
- network IP: 192.168.1.0
This was perfectly clear to me so i decided to write my own /etc/network/interfaces file where i first wanted to set my static adress withouth configuring WPA2 encryption. My file now looked like this:
auto wlan0
iface wlan0 inet static
address 192.168.1.10 #this is an IP i want for my machine
gateway 192.168.1.1 #this is an IP of my router
netmask 255.255.255.0 #netmask i got from my router
network 192.168.1.0 #i calculated this as described above
broadcast 192.168.1.12 #???
Only thing i don't understand at the moment is a broadcast adress which i just set and i don't even know what it does. I would need some explaination on this one.
For setting the WPA2 i followed this guide and my file /etc/network/interfaces got a bit larger:
auto wlan0
iface wlan0 inet static
address 192.168.1.10 #this is an IP i want for my machine
gateway 192.168.1.1 #this is an IP of my router
netmask 255.255.255.0 #netmask i got from my router
network 192.168.1.0 #i calculated this as described above
broadcast 192.168.1.12 #???
wpa-driver wext
wpa-ssid lausi
wpa-ap-scan 2
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk 8952a447c860d13847ba1cabd15314ba9caf2fb207f19598f90c43fcd43c0d97
Well this looked OK so i saved my file /etc/network/interfaces and restarted my network using comand /etc/init.d/networking restart. Although i got some error messages my Skype client worked, BUT i couldn't browse the web using my Chrome browser. Every addres like "www.google.com" ended up in a blank page with a warning that stating that the page does not exist.
This was weird, but i remembered that in Windows i allways had to specify my perferred DNS server which translates words like "www.google.com" into an IP adress like "173.194.35.180". You can check this by typing "173.194.35.180" into your browser addres bar and you will get the Google site.
Well this problem could easily be solved by adding 1 last line into my /etc/network/interfaces and it might look weird to you but it is like this dns-nameservers 193.2.1.66. This line tells my Linux machine to look at address "193.2.1.66" where my internet provider keeps a database of translations from words like "www.google.com" to addresses like "173.194.35.180" and back.
Well in my final state my file /etc/network/interfaces looked like below and it worked perfectly:
auto wlan0
iface wlan0 inet static
address 192.168.1.10 #this is an IP i want for my machine
gateway 192.168.1.1 #this is an IP of my router
netmask 255.255.255.0 #netmask i got from my router
network 192.168.1.0 #i calculated this as described above
broadcast 192.168.1.12 #???
dns-nameservers 193.2.1.66 #DNS server of my internet provider
wpa-driver wext
wpa-ssid lausi
wpa-ap-scan 2
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk 8952a447c860d13847ba1cabd15314ba9caf2fb207f19598f90c43fcd43c0d97
But still i don't know what is an broadcast IP address...
