I want to make "Ubuntu 11.10" act as a router.
I have two LAN interfaces.
Let's say interface A' IP is
interface B's IP is
How can I configure Ubuntu so that 172.16.1.1 can connect to 192.168.1.1?
Sounds as if you are configuring a router.
You only need to make a few changes to enable IP forwarding
Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
See also Ubuntu Wiki router
You will likely want to learn a little about iptables
If all that seems a bit overwhelming, may I suggest you consider one of the linux distributions that are built to act as a router ? I like smoothwall, but there are others to choose from.
Firewall specific distros will handle most or all of the configuration for you and most come with a web based interface to make it ever easier.