Le 27/02/2022 à 12:18, Marc SCHAEFER a écrit :
François Patte <francois.patte@mi.parisdescartes.fr> wrote:
Bon, alors finalement, une seule règle suffit!
>
$IPTABLES -A OUTPUT -o tun0 -j ACCEPT
>
Je me demande pourquoi openvpn met toutes ces règles (et d'autres
encore) dans ses fichiers d'exemple...
Tout dépend de votre firewall de base, aussi et des politiques.
iptables -L
(J'ai masqué l'adresse du réseau autorisé à utiliser ssh)
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT tcp -- anywhere anywhere tcp dpt:auth
ACCEPT tcp -- anywhere anywhere tcp spt:auth
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:netbios-ssn
ACCEPT tcp -- X.X.X.X/24 anywhere tcp dpt:ssh
ACCEPT all -- 192.168.1.0/24 anywhere
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT udp -- anywhere anywhere udp spt:ipp
LOG_ACCEPT all -- 10.0.0.0/24 anywhere
LOG_DROP all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
LOG_DROP all -- anywhere anywhere
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT tcp -- anywhere anywhere tcp dpt:auth
ACCEPT tcp -- anywhere anywhere tcp spt:auth
ACCEPT all -- anywhere anywhere ctstate ESTABLISHED
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere multiport dports http,https
ACCEPT tcp -- anywhere anywhere tcp dpt:imaps
ACCEPT udp -- anywhere anywhere udp dpt:ntp
ACCEPT tcp -- anywhere X.X.X.X/24 tcp dpt:ssh
LOG_ACCEPT udp -- anywhere anywhere udp dpt:openvpn
ACCEPT udp -- anywhere anywhere udp dpt:ssdp
ACCEPT all -- anywhere 192.168.1.0/24
ACCEPT udp -- anywhere anywhere udp spt:ipp
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT all -- anywhere base-address.mcast.net/24
ACCEPT all -- anywhere anywhere
LOG_DROP all -- anywhere anywhere
Chain LOG_ACCEPT (2 references)
target prot opt source destination
LOG all -- anywhere anywhere LOG level warning prefix "[IPTABLES ACCEPT] : "
ACCEPT all -- anywhere anywhere
Chain LOG_DROP (3 references)
target prot opt source destination
LOG all -- anywhere anywhere LOG level warning prefix "[IPTABLES DROP] : "
DROP all -- anywhere anywhere
Reste des mystère (pour moi!):
1- Alors que la doc openvpn dit que les requètes ont lieu vers le port 1194 (udp), quand on lance openvpn, il envoie des requètes vers le port 80, puis 443, puis vers d'autres ports et finit par utiliser le port 1194 et, donc,à établir la connexion.
2- ipv6: quand on cherche à savoir (des tas de sites proposent ce service) quel est le numéro ip attribué, on a 2 numéros, un ipv4 (qui correspond à celui que le vpn octroit) et un ipv6 qui est celui attribué par le fai... ce qui rend suspectes les affirmations de "cacher le numéro ip" des fournisseurs de vpn,
On voit ça aussi avec le dns: j'ai autorisé les connection vers le port 53, dans ce cas le serveur dns qui répond est bien celui désigné dans resolv.conf.
Si je supprime cette autorisation, le serveur dns qui répond est celui du fai avec son adresse ipv6.
-- François PatteUniversité Paris Descartes