dhcp3 server - udostępnianie internetu przez wifi
: 03 listopada 2010, 00:56
Witam.
Chcę sobie zrobić coś podobnego do serwera z laptopa by udostępnić internet poprzez wifi dla telefonu (sieć typu ad hoc odpada bo ten model telefonu nie obsługuje tego) i już na samym początku mam problem z serwerem dhcp, nie chce działać.
Po kolei przedstawię moje zestawienie.
System Debian Lenny 5.0.5
jajko 2.6.26-2-686
karta wifi atheros z zainstalowanym sterownikiem madwifi, który umożliwia jej prace jako punkt dostępowy
internet mam z sieci lokalnej. Adres dostaję przez dhcp (192.168.0.28).
Zawartość pliku etc/network/interfaces:Zawartość pliku dhcpd.conf:
Zawartość pliku /etc/default/dhcp3-server:
Zawartość pliku etc/rc.local:
Interfejs po uruchomieniu systemu:
Chcę sobie zrobić coś podobnego do serwera z laptopa by udostępnić internet poprzez wifi dla telefonu (sieć typu ad hoc odpada bo ten model telefonu nie obsługuje tego) i już na samym początku mam problem z serwerem dhcp, nie chce działać.
Po kolei przedstawię moje zestawienie.
System Debian Lenny 5.0.5
jajko 2.6.26-2-686
karta wifi atheros z zainstalowanym sterownikiem madwifi, który umożliwia jej prace jako punkt dostępowy
internet mam z sieci lokalnej. Adres dostaję przez dhcp (192.168.0.28).
Zawartość pliku etc/network/interfaces:
Kod: Zaznacz cały
# 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
auto eth0
iface eth0 inet dhcp
auto ath0
iface ath0 inet static
address 192.168.1.1
netmask 255.255.255.0
Kod: Zaznacz cały
#
# Sample configuration file for ISC dhcpd for Debian
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
ddns-update-style none;
subnet 192.168.1.0 netmask 255.255.255.0 {
interface ath0;
range dynamic-bootp 192.168.1.2 192.168.1.6;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 194.204.159.1, 194.204.152.34;
#deny unknown-clients;
default-lease-time 86400;
}
Kod: Zaznacz cały
Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts
#
# This is a POSIX shell fragment
#
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="ath0"
Kod: Zaznacz cały
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "Konfigurowanie ath0..."
wlanconfig ath0 destroy
sleep 30
wlanconfig ath0 create wlandev wifi0 wlanmode ap
sleep 1
iwconfig ath0 essid htc
sleep 1
iwconfig ath0 channel 6
sleep 1
Kod: Zaznacz cały
lysy:/home/lysy# ifconfig ath0
ath0 Link encap:Ethernet HWaddr 06:15:af:41:d3:a4
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lysy:/home/lysy# iwconfig ath0
ath0 IEEE 802.11g ESSID:"htc" Nickname:""
Mode:Master Frequency:2.437 GHz Access Point: Not-Associated
Bit Rate:0 kb/s Tx-Power:17 dBm Sensitivity=1/1
Retry :o ff RTS thr :o ff Fragment thr :o ff
Encryption key :o ff
Power Management :o ff
Link Quality=0/70 Signal level=-96 dBm Noise level=-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0