/etc/network/interafce:(kablówka) --- (modem motorola) --- (ruter D-Link 192.168.0.1/255.255.255.0) --- [eth0](ruter Debian)[eth1] --- komputer(Debian/laptop)
/etc/dhcp3/dhcp.conf:auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
Interfejs eth2 w laptopie (kabel skrosowany z ruterem):GNU nano 2.0.7 File: dhcpd.conf
ddns-update-style interim;
subnet 192.168.2.0 netmask 255.255.255.0
{
range 192.168.2.10 192.168.2.30;
option domain-name-servers 194.204.159.1, 194.204.152.34;
option netbios-name-servers 192.168.2.1;
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option routers 192.168.2.1;
default-lease-time 7200;
max-lease-time 14400;
}
Pinguję serwer z laptopa (192.168.2.1) bez problemu. Wyjścia na świat natomiast nie ma.eth2 Link encap:Ethernet HWaddr 00:0e:2e:e5:ce:30
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20e:2eff:fee5:ce30/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:472 (472.0 B) TX bytes:4424 (4.3 KiB)
Interrupt:10 Base address:0x1000
Wyjście na świat zaś jest z serwera:ping 72.14.221.104
PING 72.14.221.104 (72.14.221.104) 56(84) bytes of data.
From 192.168.0.1: icmp_seq=1 Redirect Host(New nexthop: 212.160.160.1)
From 192.168.0.1: icmp_seq=2 Redirect Host(New nexthop: 212.160.160.1)
From 192.168.0.1: icmp_seq=3 Redirect Host(New nexthop: 212.160.160.1)
From 192.168.0.1: icmp_seq=4 Redirect Host(New nexthop: 212.160.160.1)
From 192.168.0.1: icmp_seq=5 Redirect Host(New nexthop: 212.160.160.1)
From 192.168.0.1: icmp_seq=6 Redirect Host(New nexthop: 212.160.160.1)
^C
--- 72.14.221.104 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5008ms
Według mnie serwer nie przekazuje pakietów między interfejsami w routerze, jednak najważniejsza linijka jest dodana do iptables:debian:/etc/dhcp3# ping 72.14.221.104
PING 72.14.221.104 (72.14.221.104) 56(84) bytes of data.
64 bytes from 72.14.221.104: icmp_seq=1 ttl=243 time=54.3 ms
64 bytes from 72.14.221.104: icmp_seq=2 ttl=243 time=37.9 ms
64 bytes from 72.14.221.104: icmp_seq=3 ttl=243 time=34.0 ms
64 bytes from 72.14.221.104: icmp_seq=4 ttl=243 time=35.3 ms
64 bytes from 72.14.221.104: icmp_seq=5 ttl=243 time=38.3 ms
^C
--- 72.14.221.104 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4015ms
rtt min/avg/max/mdev = 34.024/39.991/54.308/7.336 ms
Uprzedzając pytania: reguły są dodawane podczas startu systemu bez problemu.echo "1" > /proc/sys/net/ipv4/ip_forward
Pełna konfiguracja iptables:
http://giver.az.pl/router/rc.tables