Closed zkryakgul closed 4 years ago
Can you try providing an IP:port
instead of just :port
for target.to_destination
?
I tried but the result is the same.
XTablesError: b'DNAT': parameter error -2 (b'192.168.6.100:443')
It only accepts if you enter the ip address without port.
I think the only thing missing is specifying the protocol:
import iptc
rule = iptc.Rule()
rule.protocol = 'tcp'
target = iptc.Target(rule, 'DNAT')
target.to_destination = ':443'
Alternatively try with iptc.easy functions? Look in the readme for High level abstractions section, there are some examples
I think the only thing missing is specifying the protocol:
import iptc rule = iptc.Rule() rule.protocol = 'tcp' target = iptc.Target(rule, 'DNAT') target.to_destination = ':443'
Yes, it's fix my issue. Thanks!
Hi, i have a problem when defining a DNAT target on iptc. Normally you can do something like this in iptables:
iptables -t nat -A PREROUTING -p tcp -m tcp -s 192.168.6.100 -d 185.X.X.X --dport 80 -j DNAT --to-destination :443
but when i try this on iptc
it's getting this error: