Reply To: Split DNS for Home Automation Project

Home Page Forums Network Management Networking Split DNS for Home Automation Project Reply To: Split DNS for Home Automation Project

#51049

ppalias
Member

Ok I see what you want. What you must do is apply a prerouting rule to do a DNAT on packets incoming the LAN interface with a destination of the publick IP address. Try the following one:

iptables -t nat -I PREROUTING -p tcp -d 222.222.222.111 --dport 80 -i ETH00 -j DNAT --to-destination 192.168.1.1:80

222.222.222.111 is your public IP address
192.168.1.1 is the internal IP address of the server
ETH00 is the LAN interface. In this example I am forwarding the http (tcp/80) port.