ho installato un ubuntu 17 su un server in una rete in cui abbiamo una connessione ad internet con 30MB in download e 30MB circa in upload.
IP del server 192.168.178.254
Codice: Seleziona tutto
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: no
dhcp6: no
addresses: [192.168.178.254/24]
gateway4: 192.168.178.1
nameservers:
addresses: [192.168.178.1,8.8.8.8]
Ho installato openvpn e la connessione al server funziona madal client non va più internet. Quindi ho installato bind9 sotto la configurazione:
Codice: Seleziona tutto
options {
directory "/var/cache/bind";
recursion yes;
forwarders {
192.168.178.1;
8.8.8.8;
};
forward only;
dnssec-enable yes;
dnssec-validation yes;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
Codice: Seleziona tutto
#!/bin/sh -e
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to 192.168.178.254
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o enp3s0 -j MASQUERADE
/sbin/iptables --append FORWARD --in-interface enp3s0 -j ACCEPT
exit 0
Codice: Seleziona tutto
port 9511
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 192.168.178.254"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
Codice: Seleziona tutto
client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote IP 9511
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
comp-lzo
setenv opt block-outside-dns
key-direction 1
verb 3
redirect-gateway def1
dhcp-option DNS 192.168.178.254
tun-mtu 1400
mssfix 1360
<ca>eccc ecc ecc</ca>
Il server funge solo da file server per i pochi pc in rete mentre dall'esterno serve che le persone possano accedere ai file presenti sul server. Non ha altri ruoli tipo dhcp o simile
dove sbaglio?
Grazie