Enviado em 11/08/2020 - 16:49h
Ola colegas.
management localhost 1196 /etc/openvpn/server/management-password
dev tun
proto udp
port 1194
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/server.crt
key /etc/openvpn/server/server.key
dh /etc/openvpn/server/dh.pem
tls-crypt /etc/openvpn/server/tc.key
crl-verify /etc/openvpn/server/crl.pem
ecdh-curve secp384r1
topology subnet
server 10.30.30.0 255.255.255.0
push "route 192.168.80.0 255.255.255.0"
;push "redirect-gateway local def1 bypass-dhcp"
push "redirect-gateway local def1"
push "remote-gateway vpn_server_ip"
push "dhcp-option DNS 192.168.80.4"
push "dhcp-option DOMAIN wollny.com.br"
client-to-client
keepalive 1800 3600
remote-cert-tls client
tls-version-min 1.2
cipher AES-256-CBC
auth SHA512
;compress lz4-v2
;push "compress lz4-v2"
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log
log /var/log/openvpn.log
;log-append /var/log/openvpn.log
explicit-exit-notify 1
;syslog
verb 5
client
dev tun
proto udp
remote myserver.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
tls-version-min 1.2
auth SHA512
ns-cert-type server
cipher AES-256-CBC
comp-lzo
verb 3
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
<tls-crypt>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-crypt>
cat /lib/systemd/system/openvpn-iptables.service
[Unit]
Before=network.target
[Service]
Type=oneshot
ExecStart=/sbin/iptables -A INPUT -i enp2s0 -m state --state NEW -p udp --dport 1194 -j ACCEPT
ExecStart=/sbin/iptables -A INPUT -i tun+ -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i tun+ -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i tun+ -o enp2s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i tun+ -o enp2s0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i enp2s0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i enp2s0 -o tun+ -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i tun+ -s 10.30.30.0/24 -d 0.0.0.0/0 -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -i tun+ -s 10.30.30.0/24 -d 0.0.0.0/0 -m conntrack --ctstate NEW -j ACCEPT
ExecStart=/sbin/iptables -t nat -A POSTROUTING -s 10.30.30.0/24 -o enp2s0 -j MASQUERADE
ExecStart=/sbin/iptables -A OUTPUT -o tun+ -j ACCEPT
ExecStop=/sbin/iptables -D INPUT -i enp2s0 -m state --state NEW -p udp --dport 1194 -j ACCEPT
ExecStop=/sbin/iptables -D INPUT -i tun+ -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i tun+ -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i tun+ -o enp2s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i tun+ -o enp2s0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i enp2s0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i enp2s0 -o tun+ -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i tun+ -s 10.30.30.0/24 -d 0.0.0.0/0 -j ACCEPT
ExecStop=/sbin/iptables -D FORWARD -i tun+ -s 10.30.30.0/24 -d 0.0.0.0/0 -m conntrack --ctstate NEW -j ACCEPT
ExecStop=/sbin/iptables -t nat -D POSTROUTING -s 10.30.30.0/24 -o enp2s0 -j MASQUERADE
ExecStop=/sbin/iptables -D OUTPUT -o tun+ -j ACCEPT
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Como gerar qualquer emoji ou símbolo unicode a partir do seu teclado
Instalar e Configurar o Slackware Linux em 2025
Como configurar os repositórios do apt no Debian 12 em 2025
Passkeys: A Evolução da Autenticação Digital
Instalação de distro Linux em computadores, netbooks, etc, em rede com o Clonezilla
Muitas dificuldades ao instalar distro Linux em Notebook Sony Vaio PCG-6131L (VPCEA24FM)
Slackpkg+ (Slackpkg Plus) está de volta!
Como dividir duas janelas igualmente e lado-a-lado na sua tela
Configurando o Conky para iniciar corretamente no sistema
3 configurações básicas que podem melhorar muito a sua edição pelo editor nano
Youtube e networkmeneger para de funcionar (5)
Minha rede tem um espaço invisível que não dá pra digitar o nome da re... (1)
Pedagogia no brasil não passa de alfabetização por m4sturbação mental ... (2)
compilação samba 4.22 rock linux 9.5 (3)
Erro de segmentação «Segmentation fault (core dumped)» ao retornar obj... (7)