
This is the output of the iptables-save, in case it's useful: # Generated by iptables-save v1.8. The python request seems to be going through without problems, and does not seem to be intercepted by the prerouting policy. Pkts bytes target prot opt in out source destinationĠ 0 REDIRECT tcp - any any anywhere anywhere tcp dpt:4567 redir ports 8443īoth the iptables and the python script are on the same machine (my laptop). import requestsĪs well as checking if any packets / bytes pass through the prerouting by looking at the output of iptables -t nat -list -v Chain PREROUTING (policy ACCEPT 4 packets, 560 bytes) For now you can do it with bitwise operation: ip saddr 10.10.10.0/24 snat to ip saddr & 255.0.0.255 0.200.0.0 'Proper' support is already in git. The site is made as to allow http requests on any port. I'm running this simple python script to test the routing.

The resulting address will be constructed in the following way: All 'one' bits in the mask are filled in from the new 'address'. It is targeted towards system administrators. to address /mask Network address to map to. iptables 1.6.1 release Hi The Netfilter project proudly presents: iptables 1.6.1 iptables is the userspace command line program used to configure the Linux 2.4.x and later packet filtering ruleset. It can only be used from rules in the nat table. I've also setup the ip_forwarding (although I'm not entirely sure whether I need that): sudo echo "1" > /proc/sys/net/ipv4/ip_forward NETMAP This target allows you to statically map a whole network of addresses onto another network of addresses.

Iptables -t nat -A PREROUTING -p tcp -dport 4567 -j REDIRECT -to-ports 8443 I've written a short script to make sure I flush and restart the iptables each time I change the rule: #!/bin/bash The target is to redirect traffic form port 4567 to 8443 and have a (local) program listen on the latter. I'm trying to understand iptables and can't seem to redirect traffic at all.
