Fedora Linux Support Community & Resources Center
  #1  
Old 16th April 2007, 06:20 PM
sciguy125 Offline
Registered User
 
Join Date: Aug 2004
Posts: 86
multiple network interfaces

One of my boxes happens to have two network interfaces on it. My ISP also happens to allow me to have several computers connected to the internet. So, I this system can have two IPs on the individual interfaces. What I want to do is separate programs by interface. eg. apache and ftp on one interface and other things on the other interface. These are dynamic IPs, so I can't just bind the servers to an address. Is it possible to bind them to an interface?
Reply With Quote
  #2  
Old 16th April 2007, 07:17 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,298
That depends on the individual application. In brief - yes it is completely possible to open a listen socket (for example) on a specific interrface, but to do this with a service requires that they expose this feature in their config files. The socket libraries can resolve an interface name (like eth1) to a ifnumke 2) and this is part of the local address opened by th socket. OTOH many applications open the local ide based on IP address or they use the any-any rule !

I would have thought that most serious network services have this capability in their configs. OTOH I don't see this in the sshd_config Listen parameter (it selects based on IP only I think) !
Reply With Quote
  #3  
Old 16th April 2007, 10:43 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,298
Let me ask you a question - why do you want to do this ?

I mean the fastest home Inet access is maybe 15-20Mbps, and the slowest dual-iface on a mobo is 100Mbps (more likely 2x1Gbps these days). So you are not buying any bandwidth. You can certainly have two URLs resolve to the same IP address - yo uyou can use dyndys or whatever to get a couple URL names for your one interface.

The one legitimate use would be to run different services on the differnt interfaces (say two different httpd servers - one on each iface. And ftp servers with different perms or whatever.

You can always use iptables to close the ports on one or the orther interface so you only see httpd on one interface and the ftp on the other (or whatever.


You also have a routing issue - let's say your eth0 and eth1 get assigned 77.12.34.56/20 and 77.12.34.78/20 respectively and both gate to your ISP's local router at 77.12.30.01 - so what sort of routine table makes sense here ?

I think your first question should be "how do I get dhcp to assign two(or ten ...) IPs to my first interface. Yeah - you can assign upto 4k (I think) IPs to the same interface.
Reply With Quote
  #4  
Old 17th April 2007, 01:57 AM
Iron_Mike's Avatar
Iron_Mike Offline
Registered User
 
Join Date: Jul 2005
Location: Ft Huachuca, AZ
Posts: 3,762
Quote:
Originally Posted by sciguy125
One of my boxes happens to have two network interfaces on it. My ISP also happens to allow me to have several computers connected to the internet. So, I this system can have two IPs on the individual interfaces. What I want to do is separate programs by interface. eg. apache and ftp on one interface and other things on the other interface. These are dynamic IPs, so I can't just bind the servers to an address. Is it possible to bind them to an interface?
Yes networking 101, theoretically I could have infinite number of computers tied into my ISP's network. BUT data transfers would suck big time. You are trying to use a computer with 2 nics to act as an router, this is doable but a PITA. Too make life easier and a whole lot simplier buy a home based router/switch , use the DMZ settings on the router to redirect data to to your apache/ftp server and everything else redirect to the other port.
Reply With Quote
  #5  
Old 17th April 2007, 06:57 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
I would go with Iron Mike, I have a cheapo 3com secure router I bought on eBay for $50. It does a great job! Stops DDOS, DMZ, forward port to certain servers, etc. All PCs has one 3com NIC. Its fast enough.

Some guys like to have a linux box to be a (iptables based w/2 NICs)router, nothing else, thought that was energy inefficiant(spell?). Secure router uses 15 watts, compare to PC runs some over 100 watts.
Whoops, I'm not nagging, its user's preferences how they want to run a router, PC based, or hardware router based.
Reply With Quote
Reply

Tags
interfaces, multiple, network

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I set up multiple virt interfaces in network-scripts [SOLVED] aliber4079 Servers & Networking 2 15th May 2009 04:34 AM
What happens with multiple network interfaces? marki Servers & Networking 4 5th May 2009 10:05 AM
Multiple network interfaces branko56 Servers & Networking 9 26th July 2008 03:52 AM
Multiple Xen interfaces drunkahol Using Fedora 0 26th February 2008 02:21 PM
FC6: cannot make multiple dummy network interfaces mschmidt4 Servers & Networking 1 8th June 2007 07:36 PM


Current GMT-time: 06:19 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat