Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 751
  • Last Modified:

Network setup with ADSL

Here is the situation:

* I have an ADSL modem which has an ethernet port.
* You can put an IP in that eth port.
* You can also put Network Address Translation (NAT) in that modem.

So, in current usage, I set the eth ip address 10.0.0.1 (255.0.0.0), and it connected to a HUB.

In the local area network (LAN), every machine will use 10.0.0.1 as the gateway.

I run several servers also in the LAN, e.g. mail server, imap, pop3, and web.

I setup all necessary NAT rules for all those servers in the modem. This works fine before.

The problem is, for some strange reason, the NAT disappeared! This happened several times.

Now, I plan to move those NAT in a linux box using iptables.

I will install a linux box with 2 network card :
- eth 0 --> 10.0.0.2 (255.0.0.0)
- eth 1 --> 192.168.0.0 (255.255.255.0)

I will connect modem:eth with linux:eth0, using cross over cable.
I will delete all NAT in the modem.

But then I dont know the rest, I meant how should I configure the NAT in the linux box?

Will this plan work? Should I setup any gateway in the modem pointed to the linux box?

Please help me.

Thanks
0
dudup
Asked:
dudup
3 Solutions
 
svenkarlsenCommented:
I will never discourage anyone from getting their hands dirty by poking around inside linux, - it's great fun.

I also believe that people should do things the easiest way, so I have to suggest that you consider getting a cheap router which will make it all much easier for you ;-)

But, - if you are determined, here is a link to a really nice step-by-step HOWTO:

http://www-jerry.oit.duke.edu/linux/HOWTO/ipchains_with_adsl_v62.html

Have fun!
0
 
ridCommented:
The modem can do NAT, you say. Is this in fact a modem/router combination?
You need to clarify if you are using DHCP for your ISP connection or if you have a static IP.
If you are on DHCP, your modem/router settings must be adjusted accordingly. For example, if you
set up a Linux-based router, the eth0 (outside NIC) should be set to use DHCP, while the eth1 should
be set to an IP consistent with  your LAN address space (192.168.X, if that is what you use).

Before doing too much work here, find out what that modem really does.
/RID
0
 
dudupAuthor Commented:
Yes, the modem(router) has static IP in its serial connection (ADSL).

What I still confused is, should I set any gateway address in modem:serial, modem:eth and linux:eth0, linux:eth1 ? to where?
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
ridCommented:
You need to clarify if the modem is indeed also a router.

If "yes", you set the outside part of the router to your assigned IP.
You se the inside of the router to an IP that is within your LAN address space.
You set your other machines to use this "inside" address as Gateway

If "no", you don't do anything with the modem. You set whatever unit is on
the inside of the modem to your assigned IP.
If you hook up a router of any description to the modem, you set this router's
outside to your assigned IP, and its inside to an IP within your LAN address space.
As said above, you seet your other nodes to use the router's inside IP as Gateway.

/RID
0
 
FocusynCommented:
For the linux machine, the gateway should be set to the lan address of the modem.  For all other machines, the gateway address will be the LAN address of eth1.
0
 
FocusynCommented:
i.e., in your current config, linux gatway would be 10.0.0.1 and all machines on lan would be 192.168.0.0
0
 
juanmamerinoCommented:
You have had a good idea but let me explain how to complete it.

Setup your router as simple DSL modem, it will work as a DCE or as a layer 2 equipment and setup your WAN IP configuration on the outside Linux NIC. Then your linux will has you ISP public IP Address on his outside interface.
The idea is that your router will be like a modem, but a dsl modem giving with no IP, as happens ondial-up connection where you setup your ISP information on the box and not on the modem.

Now you should setup NAT (and some firewall software too is recommended in this case) to map your public ports on that interface to each server in your LAN.

How to setup the router in this way (as a bridge) depends on every router and model but as far as I know every router lets you setup de router as a "modem".

Regards,

Juanma Merino
Barcelona
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now