Configuring a quick-and-dirty router and proxy

March 23, 2001, 10:30 AM —  LinuxWorld.com — 


Q: Maybe you can help. I want to set up my Mandrake 7.2 machine as a router and proxy with a 3Com 56K Message Modem (serial) as dialup-on-demand and a 3Com 3c509 Ethernet card.

A: Setting up a router and proxy is a huge subject, but I will give you the basics and some pointers to get you started. There are a couple of technical terms that you have to be familiar with. The first is "IP-Masquerading." If you refer to the IP-Masq-HOWTO located at the Linux Documentation Project Website (see Resources), it will tell you in Section 1.1: Introduction to IP Masquerading (or IP Masq for short) that:


IP Masq is a form of Network Address Translation, or NAT, that allows internally connected computers that do not have one or more registered Internet IP addresses to have the ability to communicate to the Internet via your Linux box's single Internet IP address. It is possible to connect your internal machines to the Linux host with LAN technologies like Ethernet, Token Ring, FDDI, as well as other kinds of connections such as dialup PPP or SLIP links. This document uses Ethernet for the primary example since it is the most common scenario.


In other words, you may use a single network interface to provide general Internet access to a private network. IP MASQ, then, is the baby brother of NAT.



NAT is different, though. It allows you to map external addresses or ports to internal addresses or ports. For example: I have a machine that is on a private network, but I want to allow the Internet direct access to the machine. You can use NAT to allocate a real IP address (say, 64.81.28.144) to your machine that is really located locally on 192.168.1.5. If you did this, anyone who connected to 64.81.28.144 would actually connect to the machine on 192.168.1.5. This can be very useful if you map specific ports.



Here are the basic steps that you will need to create an IP Masq gateway. I warn you, though, that these steps are basic and will do the job, but you will need to secure the firewall machine. I am not going to talk about how to make the PPP connection. If you are unsure about how to do this, take a look at the PPP-HOWTO (see Resources). I suggest using kppp or LinuxConf to set up the machine. Nor am I going to talk about setting up a basic network. If you are looking for information on that, you can refer to the Linux Networking HOWTO (see Resources).


Setting up IP Masq



IP Masq is very simple to set up. There are many ways to do it, so I'll show you

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Free books

Essential JavaFX
Get started building rich Web apps quickly with an introduction to the power of JavaFX key features -- scene node graphs, nodes as components, the coordinate system, layout options, colors and gradients, custom classes with inheritance, animation, binding, and event handlers.Enter now!

The Nomadic Developer
Consulting can be hugely rewarding, but it's easy to fail if you are unprepared. To succeed, you need a mentor who knows the lay of the land. Aaron Erickson is your mentor, and this is your guidebook. Enter now!

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace