Ubuntu 8.04 / kernel 2.6.24-19-server / TP-Link WN-551g @ MadWifi (kompilowane dla tego jądra) / uruchomiony tryb Master / uruchomiony dhcp3-server / wpisy w /etc/init.d/firewall porobione...
a jednak coś jest nie tak

Natomiast po kablu działa świetnie.
ifconfig
Kod: Zaznacz cały
ath0 Link encap:Ethernet HWaddr 00:1d:0f:b4:a8:06
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:145 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17557 (17.1 KB) TX bytes:16983 (16.5 KB)
wifi0 Link encap:UNSPEC HWaddr 00-1D-0F-B4-A8-06-E0-E3-00-00-00-00-00-00-00-00
inet addr:192.168.9.2 Bcast:192.168.9.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:252 errors:0 dropped:0 overruns:0 frame:3165
TX packets:415 errors:6 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:199
RX bytes:36012 (35.1 KB) TX bytes:35197 (34.3 KB)
Interrupt:21
Kod: Zaznacz cały
wifi0 no wireless extensions.
ath0 IEEE 802.11g ESSID:"nswr15" Nickname:""
Mode:Master Frequency:2.412 GHz Access Point: 00:1D:0F:B4:A8:06
Bit Rate:0 kb/s Tx-Power=5 dBm Sensitivity=1/1
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=48/70 Signal level=-48 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
Kod: Zaznacz cały
#Podsieć dla połączeń kablowych
subnet 192.168.7.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.1.111;
option routers 192.168.7.2;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.7.255;
default-lease-time 3600;
max-lease-time 86400;
host x03-domowy-LAN {
hardware ethernet 00:19:66:61:3e:d8;
fixed-address 192.168.7.3;
}
}
#Podsieć dla połączeń radiowych
subnet 192.168.9.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.1.111;
option routers 192.168.9.2;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.9.255;
default-lease-time 600;
max-lease-time 1800;
host x03-domowy-WLAN {
hardware ethernet 00:08:a1:a9:6b:e1;
fixed-address 192.168.9.3;
}
}
Kod: Zaznacz cały
#Włączenie w kernelu forwardowania
echo 1 > /proc/sys/net/ipv4/ip_forward
#Czyszczenie starych reguł
iptables -F
iptables -X
iptables -t nat -X
iptables -t nat -F
#Ustawienie polityki działania
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
#Łączenie się po SSH
iptables -A INPUT -i lo -j ACCEPT
iptables -A FORWARD -i lo -j ACCEPT
iptables -A INPUT -s 0/0 -d 192.168.1.2 -p tcp --dport 22777 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 192.168.1.2 -p tcp --dport 22777 -j ACCEPT
iptables -A INPUT -s 0/0 -d 192.168.1.2 -p udp --dport 22777 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 192.168.1.2 -p udp --dport 22777 -j ACCEPT
#Otwarcie portu 80 dla apache2
iptables -A INPUT -s 0/0 -p tcp --dport 80 -j ACCEPT
#Połączenia nawiązane
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
#Udostępnienie internetu w sieci lokalnej
#Dla x03-domowy -> LAN:
iptables -t nat -A POSTROUTING -s 192.168.7.3 -j MASQUERADE
iptables -A FORWARD -m mac --mac-source 00:19:66:61:3E:D8 -j ACCEPT
#Dla x03-domowy -> WLAN:
iptables -t nat -A POSTROUTING -s 192.168.9.3 -j MASQUERADE
iptables -A FORWARD -m mac --mac-source 00:08:A1:A9:6B:E1 -j ACCEPT