|
|
ru.linux- RU.LINUX --------------------------------------------------------------------- From : D. Kolpakov 2:5020/400 25 Oct 2002 16:55:23 To : Parygin Aleksey S. Subject : Re: tincd --------------------------------------------------------------------------------
Parygin Aleksey S. wrote:
>Приветствую тебя, All !
>
>"D. Kolpakov" wrote...
>
>>А кто-нить юзал subj?
>>
>Я и счас его юзаю :)
>
>С наилучшими пожеланиями, ICQ:9083691
> Парыгин Алексей mailto:paral@teplo.tchercom.ru
>
> *** Лотерея -- это налог с тех, кто не умеет считать. ***
>
Схема такая: (пропорциональный шрифт)
После многих проб выбрал адреса из примера на сайте tincd
|---|10.1.54.18 eth1|---------|172.16.0.1 eth0|-----------|eth1
10.2.1.17|---|
| |-----------------| bank |-----------------| bws
|-----------------| |
|___| 10.1.54.1|_________|eth0 172.16.0.2|___________|10.2.1.12
|___|
host1 host2
Конфигурации:
HOST1 RH7.2
[root@host1 vpn]# cat tinc.conf
Name = bank
Device = /dev/tun
#ConnectTo = bws
PrivateKeyFile = /etc/tinc/vpn/rsa_key.priv
[root@host1 vpn]# cat tinc-up
#!/bin/sh
ifconfig vpn hw ether fe:fd:0:0:0:0
ifconfig vpn 10.1.54.1 netmask 255.0.0.0
ifconfig vpn -arp
[root@host1 vpn]# cat up
kill `cat /usr/local/var/run/tinc.vpn.pid`
insmod /lib/modules/2.4.7-10/kernel/drivers/net/tun.o
tincd -c /etc/tinc/vpn -n vpn --debug=5
[root@host1 vpn]# cat hosts/bank
Address = 172.16.0.1
Subnet = 10.1.0.0/16
-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----
[root@host1 vpn]# cat hosts/bws
Address = 172.16.0.2
Subnet = 10.2.0.0/16
-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----
[root@host1 vpn]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:20:AF:C5:36:CD
inet addr:172.16.0.1 Bcast:172.16.0.127 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3317 errors:0 dropped:0 overruns:0 frame:0
TX packets:4317 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:260929 (254.8 Kb) TX bytes:276175 (269.7 Kb)
Interrupt:11 Base address:0x210
eth1 Link encap:Ethernet HWaddr 00:C0:4F:D4:F8:C0
inet addr:10.1.54.1 Bcast:10.1.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7184 errors:0 dropped:0 overruns:0 frame:0
TX packets:4753 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:633025 (618.1 Kb) TX bytes:562192 (549.0 Kb)
Interrupt:10 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:964 errors:0 dropped:0 overruns:0 frame:0
TX packets:964 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:73252 (71.5 Kb) TX bytes:73252 (71.5 Kb)
vpn Link encap:Ethernet HWaddr FE:FD:00:00:00:00
inet addr:10.1.54.1 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@host1 vpn]# iptables -L -v
Chain INPUT (policy ACCEPT 4962 packets, 346K bytes)
pkts bytes target prot opt in out source
destination
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source
destination
479 40437 ACCEPT all -- eth0 eth1 anywhere
10.1.0.0/16
676 28441 ACCEPT all -- eth1 eth0 10.1.0.0/16
anywhere
0 0 ACCEPT all -- vpn eth1 10.0.0.0/8
10.1.0.0/16
0 0 ACCEPT all -- eth1 vpn 10.1.0.0/16
10.0.0.0/8
Chain OUTPUT (policy ACCEPT 4723 packets, 431K bytes)
pkts bytes target prot opt in out source
destination
[root@host1 vpn]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
172.16.0.0 * 255.255.255.128 U 0 0 0 eth0
10.2.0.0 172.16.0.2 255.255.0.0 UG 0 0 0 eth0
10.1.0.0 * 255.255.0.0 U 0 0 0 eth1
10.0.0.0 * 255.0.0.0 U 0 0 0 vpn
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
HOST2 RH6.2
[root@host2 vpn]# cat tinc.conf
Name = bws
Device = /dev/tap0
ConnectTo = bank
PrivateKeyFile = /etc/tinc/vpn/rsa_key.priv
[root@host2 vpn]# cat tinc-up
#!/bin/sh
ifconfig tap0 hw ether fe:fd:0:0:0:0
ifconfig tap0 10.2.1.12 netmask 255.0.0.0
ifconfig tap0 -arp
[root@host2 vpn]# cat up
kill `cat /usr/local/var/run/tinc.vpn.pid`
insmod /lib/modules/2.2.14-5.0/net/ethertap.o
tincd -c /etc/tinc/vpn -n vpn --debug=5
[root@host2 vpn]# cat hosts/bank
Address = 172.16.0.1
Subnet = 10.1.0.0/16
-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----
[root@host2 vpn]# cat hosts/bws
Address = 172.16.0.2
Subnet = 10.2.0.0/16
-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----
[root@host2 vpn]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:A0:24:33:F2:AE
inet addr:172.16.0.2 Bcast:172.16.0.127 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4335 errors:0 dropped:0 overruns:0 frame:0
TX packets:3331 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x210
eth1 Link encap:Ethernet HWaddr 00:C0:4F:DA:4E:24
inet addr:10.2.1.12 Bcast:10.2.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:468 errors:0 dropped:0 overruns:0 frame:0
TX packets:561 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:10 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:418 errors:0 dropped:0 overruns:0 frame:0
TX packets:418 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
tap0 Link encap:Ethernet HWaddr FE:FD:00:00:00:00
inet addr:10.2.1.12 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Interrupt:5
[root@host2 vpn]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
10.2.1.12 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
172.16.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
172.16.0.0 0.0.0.0 255.255.255.128 U 0 0 0 eth0
10.2.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
10.1.0.0 172.16.0.1 255.255.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 tap0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.16.0.1 0.0.0.0 UG 0 0 0 eth0
При запуске скриптов ./up соединение устанавливается, пакеты от любых к
любым станциям доходят, но через vpn и tap0 интерфейсы не идет. Об этом
свидетельствует и отсутствие статистики в iptables и отсутствие
логирования пакетов на 5 уровне debug. Также через час происходит
регенерация ключей.
Что не так?
Спасибо
--- ifmail v.2.15dev5
* Origin: DeltaBank (2:5020/400)
Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.linux/6592e3654720.html, оценка из 5, голосов 10
|