Есть сетевое облако с шарой. Линуха не подключаются. выдают ошибку: "Не удалось подключить ресурс Windows. Программа вызвала разрыв соединения."
Решение:
Есть сетевое облако с шарой. Линуха не подключаются. выдают ошибку: "Не удалось подключить ресурс Windows. Программа вызвала разрыв соединения."
Решение:
ethtool eth0Получаем результат:
Settings for eth0:Нас интересуют строчка Supports Wake-on и Wake-on. Первая показывает доступные режимы сетевого адаптера на пробуждение (g - как раз пробуждение по Magic Pocket), а вторая - текущий режим (d означает выключенный WoL).
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/FullSupports auto-negotiation: Yes
1000baseT/Full
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/FullAdvertised auto-negotiation: Yes
1000baseT/Full
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes
ethtool -s eth0 wol gДля выключения режима WoL
ethtool -s eth0 wol dСетевой адаптер может поддерживать сохранение состояния, в которое его перевели, но может и сбрасывать (чаще всего на d), поэтому при каждой загрузке необходимо будет устанавливать нужный режим WoL. Добавляем в /etc/conf.d/net следующие строки - они будут включать режим WoL на всех сетевых адаптерах, которые его поддерживают:
preup() {
if ethtool $1 | grep "Supports Wake-on:" | grep g >/dev/null;
then
ethtool -s $1 wol g
fi
}
wakeonlan MAC-адрес
auto br0
iface br0 inet static
bridge_ports eth1
address 172.16.0.1
netmask 255.255.255.0
http://mindcollapse.com/blog/68.html
Ставим OpenVPN
# cp -R /usr/share/doc/openvpn/examples/easy-rsa /etc/openvpn/
export D=`pwd`
export KEY_CONFIG=$D/openssl.cnf
export KEY_DIR=/etc/openvpn/keys
echo NOTE: when you run ./clean-all, I will be doing a rm -rf on $KEY_DIR
export KEY_SIZE=1024
export KEY_COUNTRY=RU
export KEY_PROVINCE=RU
export KEY_CITY=MOSCOW
export KEY_ORG="Artur Kryukov"
export KEY_EMAIL="artur@kryukov.ru"
# . vars
NOTE: when you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/keys
#
# ./clean-all
#
# ./build-ca
Generating a 1024 bit RSA private key
..................++++++
......................................................++++++
writing new private key to 'ca.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [RU]:
State or Province Name (full name) [RU]:
Locality Name (eg, city) [MOSCOW]:
Organization Name (eg, company) [Artur Kryukov]:
Organizational Unit Name (eg, section) []:Personal Server
Common Name (eg, your name or your server's hostname) []:kryukov.ru
Email Address [artur@kryukov.ru]:
#
# ./build-key-server artur.kryukov.ru
Generating a 1024 bit RSA private key
...++++++
..++++++
writing new private key to 'artur.kryukov.ru.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [RU]:
State or Province Name (full name) [RU]:
Locality Name (eg, city) [MOSCOW]:
Organization Name (eg, company) [Artur Kryukov]:
Organizational Unit Name (eg, section) []:Personal Server
Common Name (eg, your name or your server's hostname) []:artur.kryukov.ru
Email Address [artur@kryukov.ru]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:password
An optional company name []:
Using configuration from /usr/share/doc/openvpn-2.0.5/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName :PRINTABLE:'RU'
stateOrProvinceName :PRINTABLE:'RU'
localityName :PRINTABLE:'MOSCOW'
organizationName :PRINTABLE:'Artur Kryukov'
organizationalUnitName:PRINTABLE:'Personal Server'
commonName :PRINTABLE:'kryukov.ru'
emailAddress :IA5STRING:'artur@kryukov.ru'
Certificate is to be certified until Dec 11 14:31:19 2015 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
#
# ./build-key master.kryukov.ru
Generating a 1024 bit RSA private key
.......++++++
.............................................++++++
writing new private key to 'master.kryukov.ru.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [RU]:
State or Province Name (full name) [RU]:
Locality Name (eg, city) [MOSCOW]:
Organization Name (eg, company) [Artur Kryukov]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:master.kryukov.ru
Email Address [artur@kryukov.ru]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:password
An optional company name []:
Using configuration from /usr/share/doc/openvpn-2.0.5/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName :PRINTABLE:'RU'
stateOrProvinceName :PRINTABLE:'RU'
localityName :PRINTABLE:'MOSCOW'
organizationName :PRINTABLE:'Artur Kryukov'
commonName :PRINTABLE:'master.kryukov.ru'
emailAddress :IA5STRING:'artur@kryukov.ru'
Certificate is to be certified until Dec 11 14:39:59 2015 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
#
# ./build-key home.kryukov.ru
Generating a 1024 bit RSA private key
..............................................++++++
.......................................++++++
writing new private key to 'home.kryukov.ru.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [RU]:
State or Province Name (full name) [RU]:
Locality Name (eg, city) [MOSCOW]:
Organization Name (eg, company) [Artur Kryukov]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:home.kryukov.ru
Email Address [artur@kryukov.ru]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:password
An optional company name []:
Using configuration from /usr/share/doc/openvpn-2.0.5/easy-rsa/openssl.cnf
DEBUG[load_index]: unique_subject = "yes"
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName :PRINTABLE:'RU'
stateOrProvinceName :PRINTABLE:'RU'
localityName :PRINTABLE:'MOSCOW'
organizationName :PRINTABLE:'Artur Kryukov'
commonName :PRINTABLE:'home.kryukov.ru'
emailAddress :IA5STRING:'artur@kryukov.ru'
Certificate is to be certified until Dec 11 14:42:06 2015 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
#
# ./build-dh
Generating DH parameters, 1024 bit long safe prime, generator 2
This is going to take a long time
..+.......................................................................+...+
.....+.....+...................................................................
............................+..................+.+...........+.................
...+.....++*++*++*
#
# ls /etc/openvpn/keys/#
01.pem ca.key index.txt.old 02.pem dh1024.pem master.kryukov.ru.crt 03.pem home.kryukov.ru.crt master.kryukov.ru.csr 04.pem home.kryukov.ru.csr master.kryukov.ru.key artur.kryukov.ru.crt home.kryukov.ru.key serial artur.kryukov.ru.csr index.txt serial.old artur.kryukov.ru.key index.txt.attr ca.crt index.txt.attr.old
| Файл | Машина | Назначение | Доступ |
| ca.crt | Сервер и клиенты | Сертификат корневого СА | Публичный |
| ca.key | Только на сервере | Необходим для подписи других сертификатов | Секретный |
| 1024.pem | Только на сервере | Diffie Hellman параметры | Публичный |
| artur.kryukov.ru.crt | Только на сервере | Сертификат сервера | Публичный |
| artur.kryukov.ru.key | Только на сервере | Ключ сервера | Секретный |
| home.kryukov.ru.crt | Только на клиенте | Сертификат клиента | Публичный |
| home.kryukov.ru.key | Только на клиенте | Ключ клиента | Секретный |
openssl verify -CApath /etc/openvpn/keys -CAfile ca.crt -purpose sslclient home.kryukov.ru.crt
dev tap0
proto tcp-server
comp-lzo
daemon
mode server
tls-server
port 443
user nobody
group nogroup
persist-tun
persist-key
ifconfig-pool 10.1.0.2 10.1.0.12
ifconfig 10.1.0.1 255.255.255.224
ifconfig-pool-persist ipp.txt
dh /etc/openvpn/keys/dh1024.pem
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
log /var/log/openvpn.log
status /var/log/openvpn-status.log
verb 3
dev tap
remote [server name or IP]
client
tls-client
proto tcp
port 443
comp-lzo
ns-cert-type server
user nobody
group nogroup
ping 15
ping-restart 120
ping-timer-rem
persist-tun
persist-key
# добавляем маршрут к локальной сети офиса
###route 10.1.1.0 255.255.255.224
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/client.crt
key /etc/openvpn/keys/client.key
log /var/log/openvpn.log
verb 3
http-proxy [server] [port] [файл с логином/паролем]
dev tap
proto tcp
remote [server name or IP] 443
client
nobind
tls-client
comp-lzo
ns-cert-type server
ca "C:\\Program Files\\OpenVPN\\config\\CA.crt"
cert "C:\\Program Files\\OpenVPN\\config\\winclient.crt"
key "C:\\Program Files\\OpenVPN\\config\\winclient.key"
ping 15
ping-restart 120
ping-timer-rem
persist-key
persist-tun
verb 1