Tworzę sieć 2 serwery w oddzielnych lokalizacjach a za każdym mała sieć lokalna.
Skonfigurowałem OPENVPN, łączy się on ze sobą bez problemu, ale nie przepuszcza on żadnego ruchu(pingi, pulpit zdalny). Nie mam pojęcia dlaczego.
Siec wygląda następująco 10.0.0.0 --> server (br0:10.0.0.210, eth0:79.190.x.xxx) --- internet --- server (eth0:79.190.y.yyy, eth1:10.0.0.240 tap0: 10.0.0.230) -->10.0.0.0
Chcę, aby komputery widziały się nawzajem tak, jak by były w jednej sieci.
Oto pliki konfiguracyjne.
Najpierw na serwerze tworze bridga a to konfig do niego:
Kod: Zaznacz cały
#!/bin/bash
###############################
#Set up Ethernet bridge on Linux
#Requires: bridge-utils
###############################
#define bridge interface
br="br0"
#define list of TAP interfaces to be bridged.
#for example tab="tap0 tap1 tap2".
tap="tap0"
#define physical ethernet interface to be bridged
#with TAP Interface(s) aboce.
eth="eth1"
br_ip="10.0.0.210"
br_netmask="255.0.0.0"
br_broadcast="10.0.0.255"
for t in $tap; do
openvpn --mktun --dev $t
done
brctl addbr $br
brctl addif $br $eth
for t in $tap; do
brctl addif $br $t
done
for t in $tap; do
ifconfig $t 0.0.0.0 promisc up
done
ifconfig $eth 0.0.0.0 promisc up
Kod: Zaznacz cały
proto udp
dev tap0
ca /etc/openvpn/certs/cacert.pem
cert /etc/openvpn/certs/gwcert.pem
key /etc/openvpn/certs/gwkey.pem_bezhasla
dh /etc/openvpn/certs/dh1024.pem
server-bridge 10.0.0.210 255.0.0.0 10.0.0.230 10.0.0.250
ifconfig-pool-persist ipp.txt
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
Kod: Zaznacz cały
client
dev tap0
proto udp
remote 79.190.x.xxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/certs/cacert.pem
cert /etc/openvpn/certs/usercert.pem
key /etc/openvpn/certs/userkey.pem
comp-lzo
Kod: Zaznacz cały
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter
modprobe ip_conntrack
#usuniecie wszystkich regol filtra
iptables -F
iptables -F -t nat
iptables -F -t mangle
#domyslnie przepuszczamy wszystko
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
#maskowanie
iptables -t nat -A POSTROUTING -p all -s 10.0.0.0/8 -d 0/0 -j MASQUERADE
Kod: Zaznacz cały
Tue Jun 10 13:45:40 2008 OpenVPN 2.0.9 i486-pc-linux-gnu [SSL] [LZO] [EPOLL] built on Sep 20 2007
Tue Jun 10 13:45:40 2008 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Tue Jun 10 13:45:41 2008 Diffie-Hellman initialized with 1024 bit key
Tue Jun 10 13:45:41 2008 WARNING: file '/etc/openvpn/certs/gwkey.pem_bezhasla' is group or others accessible
Tue Jun 10 13:45:41 2008 TLS-Auth MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ]
Tue Jun 10 13:45:41 2008 TUN/TAP device tap0 opened
Tue Jun 10 13:45:41 2008 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Tue Jun 10 13:45:41 2008 UDPv4 link local (bound): [undef]:1194
Tue Jun 10 13:45:41 2008 UDPv4 link remote: [undef]
Tue Jun 10 13:45:41 2008 MULTI: multi_init called, r=256 v=256
Tue Jun 10 13:45:41 2008 IFCONFIG POOL: base=10.0.0.230 size=21
Tue Jun 10 13:45:41 2008 IFCONFIG POOL LIST
Tue Jun 10 13:45:41 2008 Patryk,10.0.0.230
Tue Jun 10 13:45:41 2008 Initialization Sequence Completed
Tue Jun 10 13:47:15 2008 MULTI: multi_create_instance called
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Re-using SSL/TLS context
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 LZO compression initialized
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Control Channel MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ]
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Local Options hash (VER=V4): 'f7df56b8'
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Expected Remote Options hash (VER=V4): 'd79ca330'
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 TLS: Initial packet from 79.190.6.253:1026, sid=eb23bd03 353076ff
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 VERIFY OK: depth=1, /C=PL/ST=PL/L=Sokopowsko/O=Sanat_Sp._z_o.o./OU=Szpitalnictwo/CN=Patryk
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 VERIFY OK: depth=0, /C=PL/ST=PL/O=Sanat/OU=Szpitalnictwo/CN=Patryk
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Tue Jun 10 13:47:15 2008 79.190.5.253:1026 [Patryk] Peer Connection Initiated with 79.190.5.253:1026
Tue Jun 10 13:47:16 2008 Patryk/79.190.5.253:1026 PUSH: Received control message: 'PUSH_REQUEST'
Tue Jun 10 13:47:16 2008 Patryk/79.190.5.253:1026 SENT CONTROL [Patryk]: 'PUSH_REPLY,route-gateway 10.0.0.210,ping 10,ping-restart 120,ifconfig 10.0.0.230 255.0.0.0' (status=1)
Tue Jun 10 13:47:16 2008 Patryk/79.190.x.xxx:1026 MULTI: Learn: 4e:ed:52:29:58:c3 -> Patryk/79.190.y.yyy:1026
Kod: Zaznacz cały
Tue Jun 10 13:47:12 2008 OpenVPN 2.0.9 i486-pc-linux-gnu [SSL] [LZO] [EPOLL] built on Sep 20 2007
Tue Jun 10 13:47:12 2008 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Tue Jun 10 13:47:12 2008 WARNING: No server certificate verification method has been enabled. See [URL]http://openvpn.net/howto.html#mitm[/URL] for more info.
Enter Private Key Password:
Tue Jun 10 13:47:15 2008 WARNING: file '/etc/openvpn/certs/userkey.pem' is group or others accessible
Tue Jun 10 13:47:15 2008 LZO compression initialized
Tue Jun 10 13:47:15 2008 Control Channel MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ]
Tue Jun 10 13:47:15 2008 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Tue Jun 10 13:47:15 2008 Local Options hash (VER=V4): 'd79ca330'
Tue Jun 10 13:47:15 2008 Expected Remote Options hash (VER=V4): 'f7df56b8'
Tue Jun 10 13:47:15 2008 UDPv4 link local: [undef]
Tue Jun 10 13:47:15 2008 UDPv4 link remote: 79.190.x.xxx:1194
Tue Jun 10 13:47:15 2008 TLS: Initial packet from 79.190.x.xxx:1194, sid=94fff407 26ed2ddc
Tue Jun 10 13:47:15 2008 VERIFY OK: depth=1, /C=PL/ST=PL/L=Sokopowsko/O=Sanat./OU=Szpitalnictwo/CN=Patryk
Tue Jun 10 13:47:15 2008 VERIFY OK: depth=0, /C=PL/ST=PL/O=Sanat./OU=Szpitalnictwo/CN=Patryk
Tue Jun 10 13:47:15 2008 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Jun 10 13:47:15 2008 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Jun 10 13:47:15 2008 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Jun 10 13:47:15 2008 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Jun 10 13:47:15 2008 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Tue Jun 10 13:47:15 2008 [Patryk] Peer Connection Initiated with 79.190.5.252:1194
Tue Jun 10 13:47:16 2008 SENT CONTROL [Patryk]: 'PUSH_REQUEST' (status=1)
Tue Jun 10 13:47:16 2008 PUSH: Received control message: 'PUSH_REPLY,route-gateway 10.0.0.210,ping 10,ping-restart 120,ifconfig 10.0.0.230 255.0.0.0'
Tue Jun 10 13:47:16 2008 OPTIONS IMPORT: timers and/or timeouts modified
Tue Jun 10 13:47:16 2008 OPTIONS IMPORT: --ifconfig/up options modified
Tue Jun 10 13:47:16 2008 OPTIONS IMPORT: route options modified
Tue Jun 10 13:47:16 2008 TUN/TAP device tap0 opened
Tue Jun 10 13:47:16 2008 ifconfig tap0 10.0.0.230 netmask 255.0.0.0 mtu 1500 broadcast 10.255.255.255
Tue Jun 10 13:47:16 2008 Initialization Sequence Completed
[ Dodano: 2008-06-13, 10:00 ]
problem rozwiazany.
Na kliecie trzeba też skonfigurować most