Доброе время суток всем!
Обращаюсь за помощью ибо Google, поиск по этому форуму + собственная голова не могут найти решение проблемы уже несколько дней.
Проблема в следующем: есть машина с Fedora Core 3 которая используется как gateway в инет для машин из локалки. eth0 находится в локалке, eth1 в инете.
В общем все работает, за исключением одного НО - наблюдается странный эффект: когда машина из локалки пытается пойти в инет то на первые пакеты она получает от FC3 сервера (c внешнего интерфейса 81.30.165.2) ICMP Destination Host Unreachable но после 3-4 (иногда до 15) пакетов сервер перестает слать ICMP квитанции и все работает. Со стороны клиента это выглядит как будто результирующий хост действительно не отвечает, однако после очередной попытки подконнектится (сервер как будто кеширует маршрут?) все начинает работать. Вот пример пинга с локальной клиентской машины:
D:\work\docs\#trash>ping mail.ru
Pinging mail.ru [194.67.57.26] with 32 bytes of data:
Reply from 81.30.165.2: Destination host unreachable.
Reply from 81.30.165.2: Destination host unreachable.
Reply from 194.67.57.26: bytes=32 time=1196ms TTL=237
Reply from 194.67.57.26: bytes=32 time=137ms TTL=237
Ping statistics for 194.67.57.26:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 137ms, Maximum = 1196ms, Average = 333ms
Пример пинга с самого сервера:
[root@buggerfly etc]# ping mail.ru
PING mail.ru (194.67.57.26) 56(84) bytes of data.
From centermul-dastor.vntp.net (81.30.165.2) icmp_seq=1 Destination Host Unreachable
From centermul-dastor.vntp.net (81.30.165.2) icmp_seq=2 Destination Host Unreachable
From centermul-dastor.vntp.net (81.30.165.2) icmp_seq=3 Destination Host Unreachable
64 bytes from mail.ru (194.67.57.26): icmp_seq=4 ttl=238 time=2330 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=5 ttl=238 time=1338 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=6 ttl=238 time=382 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=7 ttl=238 time=242 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=8 ttl=238 time=153 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=9 ttl=238 time=168 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=10 ttl=238 time=166 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=11 ttl=238 time=147 ms
64 bytes from mail.ru (194.67.57.26): icmp_seq=12 ttl=238 time=141 ms
--- mail.ru ping statistics ---
13 packets transmitted, 9 received, +3 errors, 30% packet loss, time 12004ms
rtt min/avg/max/mdev = 141.928/563.503/2330.284/721.902 ms, pipe 4
Сетевая конфигурация сервера:
[root@buggerfly etc]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:D8:24:28:D7
inet addr:10.0.9.1 Bcast:10.0.9.255 Mask:255.255.255.0
inet6 addr: fe80::211:d8ff:fe24:28d7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:191320 errors:0 dropped:0 overruns:0 frame:0
TX packets:202605 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28886814 (27.5 MiB) TX bytes:90443793 (86.2 MiB)
Interrupt:5 Memory:fe700000-0
eth1 Link encap:Ethernet HWaddr 00:0E:2E:31:49:DD
inet addr:81.30.165.2 Bcast:81.30.165.3 Mask:255.255.255.252
inet6 addr: fe80::20e:2eff:fe31:49dd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:153112 errors:1 dropped:0 overruns:0 frame:0
TX packets:192923 errors:0 dropped:0 overruns:0 carrier:0
collisions:161 txqueuelen:1000
RX bytes:79500854 (75.8 MiB) TX bytes:27676561 (26.3 MiB)
Interrupt:11 Base address:0xe000
[root@buggerfly etc]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
81.30.165.0 0.0.0.0 255.255.255.252 U 0 0 0 eth1
10.0.9.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 81.30.165.2 0.0.0.0 UG 0 0 0 eth1
[root@buggerfly etc]# iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 10.0.9.0/24 0.0.0.0/0
drop-and-log-it all -- 10.0.9.0/24 0.0.0.0/0
drop-and-log-it tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x12/0x12 state NEW
ACCEPT icmp -- 0.0.0.0/0 81.30.165.2
ACCEPT all -- 0.0.0.0/0 81.30.165.2 state RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:68 dpt:67
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp spt:68 dpt:67
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
drop-and-log-it all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
drop-and-log-it all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 81.30.165.2 10.0.9.0/24
ACCEPT all -- 10.0.9.0/24 10.0.9.0/24
drop-and-log-it all -- 0.0.0.0/0 10.0.9.0/24
ACCEPT all -- 81.30.165.2 0.0.0.0/0
ACCEPT tcp -- 10.0.9.0/24 255.255.255.255 tcp spt:67 dpt:68
ACCEPT udp -- 10.0.9.0/24 255.255.255.255 udp spt:67 dpt:68
Chain drop-and-log-it (5 references)
target prot opt source destination
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
[root@buggerfly etc]# iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 0.0.0.0/0 0.0.0.0/0 to:81.30.165.2
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Помогите кто чем может!! :)
Best wishes,
Dmitry