i am having Ubuntu box with two nic,eth0:for private and eth1 for public with static ip assigned.

on eth0: eth1:x.x.106.111

I want to set this box as Default gateway for all the other machines and wan to do NAT ing on it.

But after assigning Ip address in eth1 i am not able to ping network and Public Ips.


default x.x.106.1 iface eth1

x.x.106.0 * eth1 * eth0

How to solve this,can some one tell me what is the difference in making gw through eth0 and eth1


Not sure I understand your problem, but...

the default gateway should definitely be the gateway on the public network side (e.g. your ISP's gateway). With that in mind, your routing table looks good (x.x.106.1 is the public network gateway, right?)

On this Ubuntu machine, try pinging hosts on both networks. If it works, you're doing fine. If not, start checking if the firewall is up or even simple stuff like if the cables are connected properly (happens more often that we'd like to admit).

The next steps are a) enabling IP forwarding b) setting up iptables to perform NAT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.