I need to set up routing, preferably with iptables, that does no NAT. Basically I will have a number of clients on subnet 192.168.1.0/24 and they need their traffic to go through a gateway, say 192.168.1.1 and that gateway then passes on the request, without translating the original address, to another gateway, say 192.168.0.100. What I really want to do is use iptables so I can configure a fine grain firewall to do the routing but all I can find info on is how to do this with NAT. Which I have done before. Any insight on how to do the routing without NAT?
Routing without NAT is just like routing with NAT... only without the NAT. You add routing table entries to indicate next-hop destinations.
Firewalling without NAT is just like firewalling with NAT... only without the NAT. You add firewall rules to permit traffic with certain attributes (source/dest addresses and ports, protocols, state parameters, etc) in like with organisational policy.
No need nat here, add your deny/accept rules to
FORWARD chain of
also don't forget to enable forwading on both devices:
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
or setup it via sysctl (