Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My ISP had given me a /30 network. Later, when I wanted more public ips, I requested for a /29 network. I was told to keep using my earlier /30 network on the interface which is facing ISP, and the newly given /29 network should be used on the other interface which connects to my NAT router and servers.

This is what I got from the isp:



I have a Ubuntu pc which has two interfaces. So I am planning to do the following:

eth0 will be given gateway
eth1 will be given

And I will have the following in the /etc/sysctl.conf:


These will be iptables rules:

iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

My clients which have the ips and will be made to use as gateway.

Will this configuration work for me? Any comments? If it works, what iptables rules can I use to have a bit of security?

P.S. Both networks are non-private and there is no NATing.

share|improve this question

I'm not very clear how this is set up / how you think it will work ("which connects to my NAT router....there is no NATing").

But from what I can see this is likely to break in strange and esoteric ways.

Consider, a client outside connects to, but the reply might come from - you certainly won't be able to run any stateful firewalling.

While it is quite possible to configure Linux to handle the routing sensibly, it'd be a lot simlper to partition the networks across 2 routers - even if one of them is a virtual machine.

share|improve this answer
NAT router will have as ip (it'll exist in network), and default gateway for it is (the one I want to set up). – nixnotwin Nov 22 '11 at 13:45
The router, the ISP should have set up to connect different WAN networks, should be installed by me. So, now I should have a router to forward traffic between my old WAN subnet (/30) and the new one (/29). – nixnotwin Nov 22 '11 at 13:54

Besides the iptables configuration which I have no idea about, I think it will work for you but you shouldn't forget the routing table of the Linux system to make ethics as the default.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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