Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-29-2011, 12:13 PM   #1
Registered: May 2004
Posts: 204

Rep: Reputation: 30
Debian 5 box with two nics acting as router

I've asked this question around before but never ended up figuring out how to actually accomplish what I was trying to do. I've been told different things by people and most of the info I find online is really old... or is confusing. I really just need some specific help.

I have a Debian 5 system with two nics. eth0 is set up with dhcp-client which will receive a public ip address from my isp. The eth1 will be for my local network and I want to use dhcp-server daemon to serve addresses to my internal network.

The area I am confused about is how transmissions are getting sent between nics. I've been told to enable tcp forwarding but I don't understand how that would work since the nics have different network addresses... unless tcp forwarding is basically nat or something..
Old 07-30-2011, 10:21 AM   #2
Registered: Dec 2010
Distribution: Debian testing
Posts: 148

Rep: Reputation: 16
You are right and you also need NAT since private IPs will not be routed on public routers
Old 08-01-2011, 07:09 PM   #3
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Originally Posted by dave247 View Post
The area I am confused about is how transmissions are getting sent between nics
Well, that's something you learn when studying networking basics. Seems to me, you should consider reading something like this:, old but some parts are still pertinent. Or this:, newer info. And some "Networking 101" books. There are some CCNA books that are pretty good, IMHO.

Anyway, a quick-and-dirty answer: The way in which packets are transferred between different NICs (between different networks, that is) is called "Routing". You configure your gateway with some info, called "routing tables", which are used to decide where a packet should go. For example, one packet wants to go to your LAN, then your gateway routes it through the NIC that is connected to the LAN. If another packet wants to go to the Internet, then your gateway routes through your ISP connection.

If what you want is getting your LAN to access the Internet through your gateway, then yes, you could use NAT/Masquerading


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
using usb port as nic? (Debian system acting as router/firewall) dave247 Linux - Hardware 1 02-23-2011 04:22 PM
help for project: linux box acting as a router route Linux - Networking 2 02-09-2009 12:10 AM
Box with 3 NICS to act as router? KiLLaWaBBiT Linux - Networking 4 01-20-2008 12:05 PM
Apache is not working on my Linux box that is acting as a router notapplicable Linux - Networking 8 06-27-2007 03:49 AM
2 NICs, can't detect eth1 - router/fw box slackhack Linux - Networking 2 08-01-2005 07:43 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration