Passerelle Iptables
Résolu
yirkkiller
-
yirkkiller -
yirkkiller -
Bonjour,
Je réalise une passerelle sous Linux selon le schéma suivant :
Ma machine : 50.56.161.23/16
qui héberge deux machines virtuelles :
Machine passerelle : 50.56.60.26/16 (Bridge) d'un côté et 192.168.0.1/24 (réseau interne) de l'autre.
Machine de test : 192.168.0.2/24 (réseau interne).
Ma configuration IPTABLES sur la passerelle :
root@ubuntu:~# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
ACCEPT igmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTAB LISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:webmin
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTAB LISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT igmp -- anywhere anywhere
ACCEPT tcp -- anywhere 192.168.0.2 tcp dpt:2222 state NEW
ACCEPT tcp -- anywhere 192.168.0.2 tcp dpt:webmin stat e NEW
ACCEPT all -- 192.168.0.0/24 anywhere state NEW
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@ubuntu:~# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere anywhere tcp dpt:2222 to:192.168.0.2:2222
DNAT tcp -- anywhere anywhere tcp dpt:11000 to:192.168.0.2:10000
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE tcp -- anywhere anywhere tcp dpt:2222
MASQUERADE tcp -- anywhere anywhere tcp dpt:11000
Mes redirections de ports marchent (j'arrive à accéder en SSH 2222 sur la machine de test par exemple) mais la machine de test n'arrive pas à joindre le réseau 50.56.0.0/16 au delà de la passerelle (mais arrive à pinger 50.56.60.26, IP WAN de la VM passerelle).
Merci pour votre aide
Cdt
Je réalise une passerelle sous Linux selon le schéma suivant :
Ma machine : 50.56.161.23/16
qui héberge deux machines virtuelles :
Machine passerelle : 50.56.60.26/16 (Bridge) d'un côté et 192.168.0.1/24 (réseau interne) de l'autre.
Machine de test : 192.168.0.2/24 (réseau interne).
Ma configuration IPTABLES sur la passerelle :
root@ubuntu:~# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
ACCEPT igmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTAB LISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:webmin
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTAB LISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT igmp -- anywhere anywhere
ACCEPT tcp -- anywhere 192.168.0.2 tcp dpt:2222 state NEW
ACCEPT tcp -- anywhere 192.168.0.2 tcp dpt:webmin stat e NEW
ACCEPT all -- 192.168.0.0/24 anywhere state NEW
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@ubuntu:~# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere anywhere tcp dpt:2222 to:192.168.0.2:2222
DNAT tcp -- anywhere anywhere tcp dpt:11000 to:192.168.0.2:10000
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE tcp -- anywhere anywhere tcp dpt:2222
MASQUERADE tcp -- anywhere anywhere tcp dpt:11000
Mes redirections de ports marchent (j'arrive à accéder en SSH 2222 sur la machine de test par exemple) mais la machine de test n'arrive pas à joindre le réseau 50.56.0.0/16 au delà de la passerelle (mais arrive à pinger 50.56.60.26, IP WAN de la VM passerelle).
Merci pour votre aide
Cdt