eth0 - tu przychodzi Internet z routera
ath0 - karta wifi, skonfigurowana jako AP, udostępnia mi Internet na laptopa
eth1 - no własnie, i z tego chciałbym wypuścić dalej Internet na drugi komputer stacjonarny (połączenie cross), jednak mam z tym jakiś dziwny problem z którym męczę sie już od kilku dni i nie wiem co robię źle.
Konfiguracja wyglada tak:
eth0 (przydzielane z DHCP)
IP: 192.168.1.68
Maska: 255.255.255.0
Brama: 192.168.1.254
DNS: 192.168.1.254
ath0
IP: 192.168.0.1
Maska: 255.255.255.248
Na nim uruchomiony AP z zabezpieczeniami + serwer DHCP który przydziala konfigurację na laptopy. Wszystko działa jak należy.
eth1:
IP: 192.168.10.1
Maska: 255.255.255.0
Do tego przyłączam komputer stacjonarny któremu przypisałem statycznie:
IP: 192.168.10.2
Maska: 255.255.255.0
Brama: 192.168.10.1
DNS: 192.168.10.1
I tu zaczynają się schodki, bowiem komputery mają nawet problem z "pingowaniem" siebie nawzajem, nie mówiąc już o Internecie. I tu proszę o pomoc. Moje pomysły się wyczerpały.
Plik /etc/network/interfaces
Kod: Zaznacz cały
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.10.1
netmask 255.255.255.0
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 "Filtrowanie pakietow..."
# Odpalenie przekazywania pakietow IP
echo "1" > /proc/sys/net/ipv4/ip_forward
# Czyszczenie tablic NAT-a i filtrowania
iptables -F -t nat
iptables -X -t nat
iptables -F -t filter
iptables -X -t filter
# Brak pozwolenia na forward pakietow
iptables -t filter -P FORWARD DROP
# Przepuszczanie pakietow z sieci i do sieci
iptables -t filter -A FORWARD -s 192.168.0.0/255.255.0.0 -d 0/0 -j ACCEPT
iptables -t filter -A FORWARD -s 0/0 -d 192.168.0.0/255.255.0.0 -j ACCEPT
# Udostepnienie netu przez maskarade
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d 0/0 -j MASQUERADE
# Przepuszczanie duzych pakietow
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
#echo "Konfigurowanie eth0..."
#dhcpcd eth0
#sleep 1
#echo "Konfigurowanie eth1..."
#ifconfig eth1 192.168.10.1 netmask 255.255.255.0
#sleep 1
echo "Konfigurowanie ath0..."
wlanconfig ath0 destroy
sleep 30
wlanconfig ath0 create wlandev wifi0 wlanmode ap
sleep 1
iwconfig ath0 essid home_lan
sleep 1
ifconfig ath0 192.168.0.1 netmask 255.255.255.248
sleep 1
iwconfig ath0 key 11112222333344445555666677
sleep 1
/etc/init.d/dhcp3-server start
sleep 1
arp -s 192.168.0.6 00:02:78:99:1B:1B
arp -s 192.168.0.5 00:1D:D9:2C:5B:23
arp -s 192.168.0.4 00:1C:BF:47:9E:23
arp -s 192.168.0.3 00:00:00:00:00:03
arp -s 192.168.0.2 00:00:00:00:00:02
exit 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.0.0 netmask 255.255.255.248 {
interface ath0;
# range dynamic-bootp 192.168.0.2 192.168.0.6;
option subnet-mask 255.255.255.248;
option broadcast-address 192.168.0.7;
option routers 192.168.0.1;
option domain-name-servers 208.67.222.222, 208.67.220.220;
#deny unknown-clients;
default-lease-time 86400;
host palmtop {
hardware ethernet 00:02:78:99:1B:1B;
fixed-address 192.168.0.6;
}
host laptop {
hardware ethernet 00:1D:D9:2C:5B:23;
fixed-address 192.168.0.5;
}
host grybos {
hardware ethernet 00:1C:BF:47:9E:23;
fixed-address 192.168.0.4;
}
host host3 {
hardware ethernet 00:00:00:00:00:03;
fixed-address 192.168.0.3;
}
host host2 {
hardware ethernet 00:00:00:00:00:02;
fixed-address 192.168.0.2;
}
}