LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-29-2011, 11:13 AM   #1
dave247
Member
 
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, 09:21 AM   #2
Dani1973
Member
 
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

http://wiki.linuxquestions.org/wiki/..._a_gateway/nat
 
Old 08-01-2011, 06:09 PM   #3
HasC
Member
 
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
Quote:
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:
http://tldp.org/HOWTO/NET3-4-HOWTO.html, old but some parts are still pertinent. Or this: http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking, 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
 
  


Reply


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 03:22 PM
help for project: linux box acting as a router route Linux - Networking 2 02-08-2009 11:10 PM
Box with 3 NICS to act as router? KiLLaWaBBiT Linux - Networking 4 01-20-2008 11:05 AM
Apache is not working on my Linux box that is acting as a router notapplicable Linux - Networking 8 06-27-2007 02:49 AM
2 NICs, can't detect eth1 - router/fw box slackhack Linux - Networking 2 08-01-2005 06:43 PM


All times are GMT -5. The time now is 06:23 AM.

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