Mam serwer pełniący też rolę rutera. Budowa sieci wygląda następująco:
ISP ---- modem USB -----ppp0 (dynamiczne IP)------ serwer/router ---eth0 (karta LAN) ---------- komputer1[INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][RIGHT][INDENT][INDENT][INDENT][INDENT] I---------------------------------------------------------------------------------------------------------wlan0(karta Wifi pełniąca rolę AP)
[/INDENT][/INDENT][/INDENT][/INDENT][/RIGHT]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][RIGHT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT]bezprzewodowo komputer2
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/RIGHT]
Na tym serwerze mam uruchomione dhcp.
Konfiguracja /etc/network/interfaces
Kod: Zaznacz cały
auto eth0
iface eth0 inet static
address 192.168.1.150
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
#gateway 192.168.1.1
auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
wireless-essid internet_wifi
wireless-mode master
#gataway 195.114.190.151
auto ppp0
iface ppp0 inet ppp
provider ppp0
Kod: Zaznacz cały
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.99;
option domain-name-servers 194.204.159.1, 192.168.1.100;
option domain-name "pawel.pl";
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 21600;
max-lease-time 43200;
}
Kod: Zaznacz cały
eth0 Link encap:Ethernet HWaddr 00:27:1e:04:07:b7
inet addr:192.168.1.150 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::227:eff:fe04:7b7/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:88 errors:0 dropped:0 overruns:0 frame:0
TX packets:325 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11051 (10.7 KiB) TX bytes:41156 (40.1 KiB)
Interrupt:219 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:535 errors:0 dropped:0 overruns:0 frame:0
TX packets:535 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:96876 (94.6 KiB) TX bytes:96876 (94.6 KiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:77.254.196.247 P-t-P:195.114.190.151 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:9178 Metric:1
RX packets:2589 errors:0 dropped:0 overruns:0 frame:0
TX packets:2304 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1125196 (1.0 MiB) TX bytes:346099 (337.9 KiB)
wifi0 Link encap:UNSPEC HWaddr 00-60-C3-64-3D-4B-77-6C-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13225 errors:0 dropped:0 overruns:0 frame:0
TX packets:394 errors:0 dropped:6 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:948633 (926.3 KiB) TX bytes:71415 (69.7 KiB)
Interrupt:20
wlan0 Link encap:Ethernet HWaddr 00:6A:b3:64:3d:4b
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::260:b3ff:fe64:3d4b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:170 errors:0 dropped:164 overruns:0 frame:0
TX packets:392 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26572 (25.9 KiB) TX bytes:71727 (70.0 KiB)
Interrupt:20
Kod: Zaznacz cały
]
195.114.190.151 dev ppp0 proto kernel scope link src 77.254.196.247
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.150
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.1
Kod: Zaznacz cały
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
Lecz nic też nie może wyjść poza sieć lokalną:
Kod: Zaznacz cały
ping wp.pl
Proszę o pomoc w tej sprawie.