You are not logged in.
Pages: 1
For example, I have a wifi network with essid "MWM", with key "1234567890", and I want to connect to it using an static IP:
IP: 192.168.1.5
MASK: 255.255.255.0
IP Gateway: 192.168.1.1
What commands I must use to connect to that wifi with the previous information? Only commands, i don't want to modify rc.conf.
Greetings
Only deaths can see the end of battles.
Blog: http://djmartinez.co.cc -> The life of a Computer Engineer
Offline
For example, I have a wifi network with essid "MWM", with key "1234567890", and I want to connect to it using an static IP:
IP: 192.168.1.5
MASK: 255.255.255.0
IP Gateway: 192.168.1.1What commands I must use to connect to that wifi with the previous information? Only commands, i don't want to modify rc.conf.
Greetings
If it is WEP, you could try:
iwconfig essid MWM key 1234567890
ifconfig <interface> 192.168.1.5 netmask 255.255.255.0 up
route add default gw 192.168.1.1
Offline
I assume that the wifi network is WPA encrypted.
1) Install wpa_supplicant (probably they are already inshttp://bbs.archlinux.org/post.php?tid=43818talled).
2) Generate a wpa_supplicant.conf for your network:
wpa_passphrase MWM 1234567890 > /etc/wpa_supplicant.conf
3) Run wpa_supplicant:
wpa_supplicant -B -i eth1 -Dwext -w
Obviously this is right if eth1 IS your wireless interface (you can identify it with iwlist scan) and if wext is the right driver (some wireless clients require a different wpa driver)
4) Run ifconfig
ifconfig eth1 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.0.255 up
5) Define the gateway
route add default gw 192.168.1.1
With the netcfg2 package you can automatize all this to a single command. Look in /etc/network.d/examples/ for details. You do not need to modify anything in /etc/rc.conf, it will be enough to do:
netcfg2 <nameoftheprofileyouhavecreated>
Last edited by patroclo7 (2008-02-12 16:36:01)
Mortuus in anima, curam gero cutis
Offline
Splendid, patroclo7. Excellent tip. I never used WPA, but I might try it now that you have simplified it so.
My example works for me with WEP.
Offline
Yes, your example was fine, but I have seen it only when I had already written mine; sorry for the duplication of effort.
Mortuus in anima, curam gero cutis
Offline
Yes, your example was fine, but I have seen it only when I had already written mine; sorry for the duplication of effort.
No, no apology necessary. Thank you for the info.
Offline
Pages: 1