Hello,
I 've a problem with my net.
I've xubuntu 7.10, on a pc with 2 ethernet cards.
I want create a server with firewall

ip eth0=n,m,0,254
ip eth1=n,m,1,2
gateway(n,m,0,254) _____ server
my net--->(layer n,m,0,x)-->|eth0 |
| | gateway eth1
|_eth1|--->layer n,m,1,x----------->(modem adsl)--->INTERNET
ip n.m.1.1
I can configure both eth0 e eth1 but i cannot configure the route between the two cards (I need to see internet in my net..) I can see from the server internet...
How can i create the route between eth0 and eth1? I've tried with: route add -net n,m,0,254 netmask 255.255.255.0 gw n,m,1,1 but it says that the netmask is unuseful and when i don't give the netmask this become automatically 255.255.255.255 ....
Please help me..

__________________________

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mpc26's picture

this image is not what i mean

On February 14th, 2008 mpc26 says:

The original structure was
mynet (level0)-->server eth0(level0)-->sever eth1(level1)-->modem adsl(level1)(internet)
mynet has the gateway that is the the eth0's ip and the eth1's gateway is the modem adsl ip
thanks..

FredR's picture

What you're looking for is

On February 27th, 2008 FredR says:

What you're looking for is probably not a route.

I read your post a few times and I believe I understand it. You can post the real ips here I don't think it will hurt.

I think what you're saying is, say for example, eth0 = 192.168.0.7. And eth1 = 192.168.1.1.

You want to route the 192.168.0.x "stuff" (or packets) to 192.168.1.1 so that it may traverse out the modem to the public internet.

But the problem is, the modem is set for Nat mode, and probably will only nat addresses it knows about - 192.168.1.x!

You could tell your modem to be a bridge and setup IPtables and forwarding on your Linux machine, but you may also have to delve into pppoe as well. (Most ADSL providers use pppoe).

A simpler solution may be that, the routing is working and the natting isn't, reconfigure the modem to broaden it's network!

In other words if the network on the modem accomodates 192.168.1.X, change the subnet mask from 255.255.255.0 to 255.255.0.0 ... then it will handle 192.168.x.x!

Chances are though, the dsl modem is better at being a modem than it is being a router. I would recommend you get a dedicated piece of equipment like a Linksys WRT router (they run Linux too!), put the modem in "bridge" mode (your provider can tell you how) and have the WRT do pppoe and Nat.

You'll benefit from the power of Linux, it's a more powerful device than the puny modem your provider provides, but without the electricity usage of a dedicated PC.

As for the extra ethX nic? Use it for a test lab! Hook another linux machine on the other side and play around on the inside of your network.

__________________________

-- FLR or flrichar is a superfan of Linux Journal, and goofs around in the LJ IRC Channel

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.


Read this issue