А что если вместо линукса использовать виндовс то сеть работает через ethernet - wifi?
настройка маршрутов
А что если вместо линукса использовать виндовс то сеть работает через ethernet - wifi?
Да тогда все шикарно).
на машине которая подключена по ethernet пишу route add "IP машины с wifi" 192.168.1.1
на машине которая подключена по wifi пишу route add "IP машины с ethernet" 192.168.1.1
После пинги идут в обе стороны.
На каком основании такая метрика:
[console]link-local * 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 * 255.255.255.0 U 1 0 0 eth0[/console]
Так пингуется:
route del default
route add default gw 192.168.1.1
На каком основании такая метрика:
[console]link-local * 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 * 255.255.255.0 U 1 0 0 eth0[/console]
Почему такая метрика понятия не имею ее так поставила ubuntu 12.04
Так пингуется:
route del default
route add default gw 192.168.1.1
Так не пингуеться тоже, пробывал еще так
route del default
route add default gw 192.168.1.1 dev eth0
Результат нету пинга тоже.
Сам шлюз пингуется постоянно?
Шлюз да . (если ты имешь ввиду роутер 192.168.1.1).
Тогда анализируйте трафик с помощью:
tcpdump -ne -i eth0
....
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default *.*.*.* 0.0.0.0 UG 0 0 0 ppp0
link-local * 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 * 255.255.255.0 U 1 0 0 eth0
192.168.93.0 * 255.255.255.0 U 0 0 0 vmnet1
192.168.153.0 * 255.255.255.0 U 0 0 0 vmnet8
*.*.*.* * 255.255.255.255 UH 0 0 0 ppp0Пинг на роутер и анализ трафика.
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.291 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.251 ms
64 bytes from 192.168.1.1: icmp_req=3 ttl=64 time=0.268 ms
64 bytes from 192.168.1.1: icmp_req=4 ttl=64 time=0.297 ms
18:14:21.751624 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 1, length 64
18:14:21.751901 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 1, length 64
18:14:22.753654 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 2, length 64
18:14:22.753890 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 2, length 64
18:14:23.753686 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 3, length 64
18:14:23.753939 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 3, length 64
18:14:24.753691 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 4, length 64
18:14:24.753973 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 4, length 64
18:14:25.753701 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 5, length 64
18:14:25.753953 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 5, length 64
18:14:26.750942 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype ARP (0x0806), length 60: Request who-has 192.168.1.2 tell 192.168.1.1, length 46
18:14:26.750965 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype ARP (0x0806), length 42: Reply 192.168.1.2 is-at c8:60:00:54:c5:58, length 28
18:14:26.753658 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 6, length 64
18:14:26.753857 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 6, length 64
18:14:27.753689 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 7, length 64
18:14:27.753935 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 7, length 64
18:14:28.753655 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 8, length 64
18:14:28.753897 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 8, length 64
18:14:29.753658 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.1: ICMP echo request, id 8084, seq 9, length 64
18:14:29.753914 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.1 > 192.168.1.2: ICMP echo reply, id 8084, seq 9, length 64
пинг на ПК с wifi и анализ трафика
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
From 192.168.1.2 icmp_seq=1 Destination Host Unreachable
From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
From 192.168.1.2 icmp_seq=3 Destination Host Unreachable
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
From 192.168.1.2 icmp_seq=5 Destination Host Unreachable
From 192.168.1.2 icmp_seq=6 Destination Host Unreachable
18:17:59.849054 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:00.845649 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:01.845630 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:02.862883 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:03.861639 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:04.861634 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:05.878902 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:06.877636 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:07.877640 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:08.894820 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:09.893631 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:18:10.893638 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
А вот результат с такой таблицой маршрутизации
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default *.*.*.* 0.0.0.0 UG 0 0 0 ppp0
link-local * 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 * 255.255.255.0 U 1 0 0 eth0
192.168.1.3 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
192.168.93.0 * 255.255.255.0 U 0 0 0 vmnet1
192.168.153.0 * 255.255.255.0 U 0 0 0 vmnet8
*.*.*.* * 255.255.255.255 UH 0 0 0 ppp0пинг на ПК с wifi и анализ трафика
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
From 192.168.1.1: icmp_seq=1 Redirect Host(New nexthop: 192.168.1.3)
64 bytes from 192.168.1.3: icmp_req=1 ttl=127 time=3.55 ms
From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
From 192.168.1.2 icmp_seq=3 Destination Host Unreachable
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
18:20:33.299562 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.1 tell 192.168.1.2, length 28
18:20:33.299754 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype ARP (0x0806), length 60: Reply 192.168.1.1 is-at 84:c9:b2:cc:24:2d, length 46
18:20:33.299761 c8:60:00:54:c5:58 > 84:c9:b2:cc:24:2d, ethertype IPv4 (0x0800), length 98: 192.168.1.2 > 192.168.1.3: ICMP echo request, id 8217, seq 1, length 64
18:20:33.300120 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 126: 192.168.1.1 > 192.168.1.2: ICMP redirect 192.168.1.3 to host 192.168.1.3, length 92
18:20:33.300137 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:33.301037 84:c9:b2:cc:24:2d > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 192.168.1.3 tell 192.168.1.1, length 46
18:20:33.303102 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.3 > 192.168.1.2: ICMP echo reply, id 8217, seq 1, length 64
18:20:34.297632 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:35.297636 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:36.306725 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:37.305643 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:38.305637 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:39.322839 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:40.321643 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
18:20:41.321645 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28
Тут отлично видно что первый пинг прошел!... а вот остальные...
Привет. Ты говорил что если использовать две винды то они одна одну видят через роутер в случае добавления маршрута на айпишки компов соответствено. А покажы ка таблицу маршрутизацыи в таком случае.
Когда две винды
192.168.1.2 - теперь ПК с виндой.
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x3 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
0x10005 ...00 24 54 d8 6d 5d ...... Marvell Yukon 88E8040 Family PCI-E Fast Ethernet Controller
0x10006 ...18 f4 6a 37 29 ab ...... Atheros AR9285 Wireless Network Adapter
===========================================================================
===========================================================================
ªâš¢ë¥ ¬ àèàãâë:
¥â¥¢®© €à¥á ᪠á¥âš €à¥á è«î§ â¥àä¥©á ¥âàšª
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.3 25
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.1.3 192.168.1.3 25
192.168.1.2 255.255.255.255 192.168.1.1 192.168.1.3 1
192.168.1.3 255.255.255.255 127.0.0.1 127.0.0.1 25
192.168.1.255 255.255.255.255 192.168.1.3 192.168.1.3 25
192.168.147.0 255.255.255.0 192.168.147.1 192.168.147.1 20
192.168.147.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.147.255 255.255.255.255 192.168.147.1 192.168.147.1 20
192.168.150.0 255.255.255.0 192.168.150.1 192.168.150.1 20
192.168.150.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.150.255 255.255.255.255 192.168.150.1 192.168.150.1 20
224.0.0.0 240.0.0.0 192.168.1.3 192.168.1.3 25
224.0.0.0 240.0.0.0 192.168.147.1 192.168.147.1 20
224.0.0.0 240.0.0.0 192.168.150.1 192.168.150.1 20
255.255.255.255 255.255.255.255 192.168.1.3 10005 1
255.255.255.255 255.255.255.255 192.168.1.3 192.168.1.3 1
255.255.255.255 255.255.255.255 192.168.147.1 192.168.147.1 1
255.255.255.255 255.255.255.255 192.168.150.1 192.168.150.1 1На втором пк аналогично .
Не знаю в чем проблема. Сначала хватает mac-адрез шлюза и получает ответ с IP 192.168.1.3.
18:20:33.303102 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.3 > 192.168.1.2: ICMP echo reply, id 8217, seq 1, length 64Затем не знает, какой взять мас-адрес.
18:20:35.297636 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28Посмотрите после пинга ARP-таблицу:
ip neigh show dev eth0
Не знаю в чем проблема. Сначала хватает mac-адрез шлюза и получает ответ с IP 192.168.1.3. text18:20:33.303102 84:c9:b2:cc:24:2d > c8:60:00:54:c5:58, ethertype IPv4 (0x0800), length 98: 192.168.1.3 > 192.168.1.2: ICMP echo reply, id 8217, seq 1, length 64Затем не знает, какой взять мас-адрес.
text18:20:35.297636 c8:60:00:54:c5:58 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.3 tell 192.168.1.2, length 28Посмотрите после пинга ARP-таблицу:
ip neigh show dev eth0
До пинга
192.168.1.1 lladdr 84:c9:b2:cc:24:2d REACHABLEПосле
192.168.1.1 lladdr 84:c9:b2:cc:24:2d REACHABLE
192.168.1.3 FAILEDПопробуйте так:
arp -s 192.168.1.3 84:c9:b2:cc:24:2d
ping -c5 192.168.1.3
Попробуйте так:
arp -s 192.168.1.3 84:c9:b2:cc:24:2d
ping -c5 192.168.1.3
помогло!!!)) в чем секрет твоей магии ?
[quote=aliaksei1818]Попробуйте так:
arp -s 192.168.1.3 84:c9:b2:cc:24:2d
ping -c5 192.168.1.3
помогло!!!)) в чем секрет твоей магии ?[/quote]
Если не ошыбаюсь тут arp жостко привязывает МАС адрес за 192.168.1.3
Ну а вот из мана что означает параметр -с ping
[console] -c count
Stop after sending count ECHO_REQUEST packets. With deadline
option, ping waits for count ECHO_REPLY packets, until the time-
out expires.
[/console]
А можно как то автоматизировать? не очень удобно если айпи привязан к маку...
Пока что вижу только какойто скрипт который делает первый пинг (который удачный первый) и берет оттуда мак и прописывает в арп... есть что-то лучше?
Ну МАС адрес компа с 192.168.1.3 не должен менятса, просто после первого пинга, как то так происходит, убунта теряет МАС адрес 192.168.1.3 и потом не знает куда слать пакеты.
Нужно просто при загрузке один раз выполнить команду arp -s 192.168.1.3 84:c9:b2:cc:24:2d и этого должно хватить.
Я вообще не тямлю в bash програмировании но может етого будет достаточно
#!/bin/bash
arp -s 192.168.1.3 84:c9:b2:cc:24:2dСделать его исполняемым
[console]chmod +x name_script.sh[/console]
А вот мануал как его запихнуть в автозагрузку Убунты.
Это мои мысли. Может кто то подскажет способ по лучше.
Ок спс. позже попробую собрать скрипт.
Просто у айпи динамически выдаються а ПК с вифи может быть 3-4.