I am currently set up a Ubuntu server as a Router which has two network interface.
- eth0 -> Connecting to public internet ( 10.10.1.78 )
- eth0:1 -> 10.10.1.79
- eth0:2 -> 10.10.1.83
eth0:3 -> 10.10.1.81
eth1 -> 192.168.10.1
And on the eth1, it connected to a switch, and the switch connected 2 computer. The corresponding ipaddress is :
- Instance1 -> 192.168.10.10
- Instance2 -> 192.168.10.11
The network mask is 255.255.255.0 and gateway all set to 192.168.10.1.
The ubuntu already setup dns server and dhcp server. When i login to instance1 in the private, i already can access the internet and ping google.com.
For now, I need to do one thing. I want to Instance1 expose to outer network by public address 10.10.1.83. Can I set some rule to redirect all incoming traffic from router with Destination url 10.10.1.83 to private network 192.168.10.10?
Problem solved by setting rule in the iptable with Destination NAT for protocol is TCP/UDP and destination is your public ip. in Network address transaction setting.