Jump to content
shark007

Wireless acces point

Recommended Posts

Posted

Salutare, as avea si eu o mica problema, deci... am primit ca si tema sa fac un acces point cu ajutorul unui adaptor wireless, in linux, utilizand doar comenzile "ifconfig", "iwconfig" si "route". Deci:

1. Am un PC care are conexiunea la internet prin interfata ethernet. (eth0)

2. Am un adaptor wireless. (wlan0)

3. Acum vreau sa transform acel PC conectat la internet, intr-un acces point, pentru a ma conecta la internet cu telefonul sau cu laptopul prin wireless.

Ce ziceti, ma puteti ajuta si pe mine pas cu pas?

Posted (edited)

sa setezi wlan0 ca AP:

iwconfig wlan0 mode Master  -->> SAU "Master"
iwconfig wlan0 channel 6
iwconfig wlan0 essid Retea -->> SAU "Retea"
iwconfig wlan0 key 11111111 (64 bit encryption) -->> SAU iwconfig wlan0 key open (fara pass)

echo 1 > /proc/sys/net/ipv4/ip_forward 

(Din cate stiu eu) Normal linux iti routeaza direct intre echipamentele de retea... deci de route ai nevoie doar ca sa iti arate ca routeaza ...

route -FC

ifconfig nu inteleg la ce ai putea sa il folosesti... decat sa iti listeze echipamentele de retea si sa le dai up/down...sa nu zica ca nu le folosesti !!

ifconfig wlan0 down
ifconfig wlan0 up
ifconfig eth0 down
ifconfig eth0 up

LE: sau mai poti face un bridge asa:

brctl addbr br0
ifconfig wlan0 0.0.0.0
brctl addif br0 wlan0
ifconfig br0 192.168.1.115 netmask 255.255.255.0 up
route add -net 192.168.1.0 netmask 255.255.255.0 br0
route add default gw 192.168.1.1 br0

Sau sa setezi dnsmask ca DHCP pe LAN-ul nou :

WAN=eth0
LAN=wlan0
LANIP="192.168.133.1"
DHCPRANGE="192.168.133.2,192.168.133.253"

# setup forwarding and the dnsmasq service
fwd() {
iptables -A FORWARD -i $LAN -j ACCEPT
iptables -A FORWARD -o $LAN -j ACCEPT
iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig $LAN $LANIP/24 up

/usr/sbin/dnsmasq -C /dev/null >/dev/null 2>&1 \
--bind-interfaces \
--listen-address=$LANIP \
--dhcp-range=$DHCPRANGE,12h \

echo "to disable: $0 -d WAN=$WAN LAN=$LAN"
}

# remove forwarding and the dnsmasq service
unfwd() {
pkill -9 dnsmasq
ifconfig $LAN down

echo 0 > /proc/sys/net/ipv4/ip_forward

iptables -D FORWARD -i $LAN -j ACCEPT
iptables -D FORWARD -o $LAN -j ACCEPT
iptables -t nat -D POSTROUTING -o $WAN -j MASQUERADE
}

Off:

@Pugna ... Termina cu posturile aiurea... ai 95 de posturi deja (din care nici unul nu e cu si/sau despre ceva interesant) si abia te-ai inregistrat luna asta ... WTF?? Lasa post hunting-ul ca nu se accepta !!Si btw ... niciodata nu o sa fii destul de documentat daca esti Troll !!

Edited by co4ie
Posted

Stiu ca solutia ceruta este pt linux, dar am sa indic ceva similar pt Windows - se numeste Daihinia™ | when neighbors matter

Dar nu merge cu orice placa/adaptor de retea. Avantajul - nu mai nevoie si de a doua placa/adaptor de retea.

Softul este facut de un roman din Republica Moldova (unul Vrabie nu stiu cum). Ar fi recomandat daca ati mai gasi versiunea cu "donatie", pt care nu platiti nimic (-normal).

Posted

ok... da comanda

uname -a 

si scrie aici ce iti da ... poti incerca sa faci update la tot

apt-get dist-upgrade

si sa mai incerci o data !

daca nici asta nu merge

lspci | grep Wireless

si paste aici poate gasim un driver care sa functioneze si in master mode...

Posted

Deci, am dat comanda "uname -a" si mi-au aparut urmatoarele:

root@shadow-ubuntu:~# uname -a
Linux shadow-ubuntu 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 20:34:47 UTC 2011 i686 i686 i386 GNU/Linux

Am incercat si cu "apt-get dist-upgrade", dar am deja toate updaturile.

Am dat comanda "lspci | grep Wireless" si mi-au aparut urmatoarele:

root@shadow-ubuntu:~# lspci | grep Wireless
08:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)

Posted (edited)

ok... acum poti incerca asta:

apt-get install build-essential
apt-get install libssl-dev

si dupa


ifconfig wlan0 down
wget http://dl.aircrack-ng.org/drivers/ipwraw-ng-2.3.4-04022008.tar.bz2
tar -xjf ipwraw-ng*
cd ipwraw-ng
make
make install
make install_ucode
echo "blacklist ipwraw" | sudo tee /etc/modprobe.d/ipwraw

Driver-ul asta suporta monitor mode si injectie dar nu stiu exact daca suporta si Master ...

mai incerci o data sa pui in Master mode ... in speranta ca o sa mearga (desi cam peste tot pe unde am citit nu suporta master mode...) :


ifconfig wlan0 up
iwconfig wlan0 mode Master -->> SAU "Master"
iwconfig wlan0 channel 6
iwconfig wlan0 essid Retea -->> SAU "Retea"
iwconfig wlan0 key 11111111 (64 bit encryption) -->> SAU iwconfig wlan0 key open (fara pass)

Daca merge Master Mode faci un bridge intre eth0 si wlan0

brctl addbr br0
ifconfig wlan0 0.0.0.0
brctl addif br0 wlan0
ifconfig br0 192.168.1.115 netmask 255.255.255.0 up
route add -net 192.168.1.0 netmask 255.255.255.0 br0
route add default gw 192.168.1.1 br0

Edited by co4ie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...