Iptables: enruta solicitudes ntp desde lan al servidor vpn interno

Iptables: enruta solicitudes ntp desde lan al servidor vpn interno

tengo que seguir la configuración

   client                  gw with openvpn                 ntp server
192.168.10.82 ----> eth0 192.168.10.1 - tun0 10.8.0.46 ---> 10.8.0.1

donde no puedo instalar el cliente openvpn en .82

Me gustaría que .82 solicite ntp a 192.168.10.1, 192.168.10.1 enrutará la pregunta a 10.8.0.1 a través de su interfaz tun0 10.8.0.46 y luego responderá a .82

Debajo de mi configuración de iptables

# Generated by iptables-save v1.8.4 on Sun Jan  3 22:29:42 2021
*filter
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:INPUT DROP [0:0]
# Accept traffic from internal interfaces
-A INPUT ! -i eth1 -j ACCEPT
# Accept traffic with the ACK flag set
-A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT
# Allow incoming data that is part of a connection we established
-A INPUT -m state --state ESTABLISHED -j ACCEPT
# Allow data that is related to existing connections
-A INPUT -m state --state RELATED -j ACCEPT
# Accept responses to DNS queries
-A INPUT -p udp -m udp --dport 1024:65535 --sport 53 -j ACCEPT
# Accept responses to our pings
-A INPUT -p icmp -m icmp --icmp-type echo-reply -j ACCEPT
# Accept notifications of unreachable hosts
-A INPUT -p icmp -m icmp --icmp-type destination-unreachable -j ACCEPT
# Accept notifications to reduce sending speed
-A INPUT -p icmp -m icmp --icmp-type source-quench -j ACCEPT
# Accept notifications of lost packets
-A INPUT -p icmp -m icmp --icmp-type time-exceeded -j ACCEPT
# Accept notifications of protocol problems
-A INPUT -p icmp -m icmp --icmp-type parameter-problem -j ACCEPT
COMMIT
# Completed on Sun Jan  3 22:29:42 2021
# Generated by iptables-save v1.8.4 on Sun Jan  3 22:29:42 2021
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Sun Jan  3 22:29:42 2021
# Generated by iptables-save v1.8.4 on Sun Jan  3 22:29:42 2021
*nat
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]

# eth0 to 4g dongle
-A POSTROUTING -o eth1 -j MASQUERADE

intentar las siguientes líneas no funciona:

-A PREROUTING -i eth0 -p udp --dport 123 -j DNAT --to-destination 10.8.0.1:123
-A POSTROUTING -o tun0 -p udp --dport 123 -d 10.8.0.1 -j SNAT --to-source 10.8.0.46

¿cualquier sugerencia? gracias

Respuesta1

La primera respuesta de Tom Yan es la solución, la discusión posterior se debe a mi error al editar el archivo de configuración de iptables incorrecto.

información relacionada