LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-09-2006, 12:49 PM   #1
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Rep: Reputation: 0
Configuring dual network connections


Hi folks.

I have a setup issue that I just can't seem to get my arms around. I attempted to get some clearification once before in the firewall forum but didn't get any sort of useable response. Part of my problem here is that I am relatively new to Linux and still struggle quite a bit just figuring out how to get the various pieces/parts of Linux to work. I will say I had MUCH, MUCH rather use Linus as my server operating system than Windoze. However, I do find it soooo much more difficult trying to determine how to make things work. I do my research, from buying books to searching forums. And I attempt to follow all the instructions step by step. Invariably the end result is the product fails to function. Sometimes I am able to figure out what I did wrong. Other times I just can't figure out why it doesn't work. With all that said, here is my issue.

I have been working on attempting to install RHEL ES v3 for about 6 months. After my 30 day support ran out I floundered for another couple months and then discovered WhiteBox Linux. I am now attempting to install WBEL v4 on my 2 Dell servers and a Compaq desktop also running as a server. I can successfully install the O/S but I am having all sorts of difficulties setting up my network the way I want it. Or anywhere close as far as that is concerned.

I have two DSL connections coming in to my home office. One is the normal home DSL with dynamic IPs. The other is a business DSL with 5 assigned fixed IPs. I have a DSL router connected behind the home DSL modem to which I have our household workstations as well as my business workstations connected. I can't afford a router that handles multiple IP addresses so I am connecting the servers to the business DSL through a standard network switch. Once I get the servers configured in this setup I hope I will be at a point where I can consider a more secure setup. For now this is as much a learning experience as anything.

Each of the servers has two network cards installed. The configuration I am trying to set up is to have one network card connected to the business DSL and claiming one of the available IPs. Through this network card I will be running web servers, application servers, a mail server and an FTP server. I am using the second network card on each server to conect to my "internal" network that is inside the DSL router. I use this to VNC to those machines so I can do all the admin and programming work. I have converted a walk-in closet into a computer room and don't want to have to go in there to work on the machines.

I'll get to the current settings in a moment. But basically I can only get one of the interfaces to work at a time. If I have both activated only one will respond to a ping. If I disable that one then the other will respond to a ping. There have been a couple instances while playing around with the network settings that I have been able to get them both to respond but as soon as I reboot it stops. Obviously, as long as a machine doesn't respond to the ping it won't respond to anything else.

I made the early assumption that my problem was caused by the firewall. However, I have completely disabled the firewall and didn't get a change in the situation as described. I have switched connections multiple times to rule out that I have a bad network card. However, since I have the same problem on both of the machines I have attempted to set up I would have been surprised if it were that.

The goal

Here is the configuration I need to establish:

Code:

                  Internal                     External (As provided by ISP)
                                                **Not the real ip

Interface         eth1                         eth0
IP Address        192.168.1.71                 64.191.162.31**
Subnet            255.255.255.0                255.255.255.248
Gateway           192.168.1.1                  64.191.162.30**
Broadcast         192.168.1.255                64.191.162.36**
DNS               166.102.165.13               208.235.88.101
                  166.102.165.11               208.238.88.10
I basically want the machine talking to the internet through the external facing interface. And then the internal interface to only be used for things like VNC and Samba.

Actual so far

ifconfig eth0

Code:

eth0      Link encap:Ethernet  HWaddr 00:B0:D0:D1:6B:FE
          inet addr:64.191.162.31  Bcast:64.191.162.36  Mask:255.255.255.248
          inet6 addr: fe80::2b0:d0ff:fed1:6bfe/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6312 (6.1 KiB)  TX bytes:6462 (6.3 KiB)
ifconfig eth1

Code:

eth1      Link encap:Ethernet  HWaddr 00:02:B3:5B:3F:93
          inet addr:192.168.1.71  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::202:b3ff:fe5b:3f93/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:75970 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66712 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24062588 (22.9 MiB)  TX bytes:40399477 (38.5 MiB)
route -n

Code:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
64.191.162.30   0.0.0.0         255.255.255.248 U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
cat /etc/resolf.conf

Code:

nameserver 166.102.165.11
nameserver 166.102.165.13
lspci

Code:

00:00.0 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
00:00.1 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
00:04.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08)
00:06.0 VGA compatible controller: ATI Technologies Inc 3D Rage IIC (rev 7a)
00:0f.0 ISA bridge: ServerWorks OSB4 South Bridge (rev 50)
00:0f.2 USB Controller: ServerWorks OSB4/CSB5 OHCI USB Controller (rev 04)
00:11.0 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
00:11.1 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
06:04.0 PCI bridge: Intel Corp. 80960RM [i960RM Bridge] (rev 01)
06:04.1 RAID bus controller: Dell PowerEdge Expandable RAID Controller 3/Di (rev 01)
07:06.0 SCSI storage controller: Adaptec AIC-7880U (rev 02)
08:04.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08)
08:06.0 SCSI storage controller: Adaptec AHA-3960D / AIC-7899A U160/m (rev 01)
08:06.1 SCSI storage controller: Adaptec AHA-3960D / AIC-7899A U160/m (rev 01)
I know I will have a ton of firewall issues. However, until I can be sure that both interface cards are working as I expect I have turned off the firewall. (At least I think I have.)

I would appreciate it if someone could take just a little bit of time to help me understand what I am doing and then help me determine what I do wrong when I actually try to set this up. If there are other configurations that you feel are better, safer or more logical I appreciate the feedback. However, I really need to learn HOW to do things first. After over 3 months of reading and researching I must be extremely slow to not be able to figure this out. But, on the other hand, I have found it more than difficult to find ANY reference giving assistance in setting up more than one network card on a single machine.

Any help is greatly appreciated.

Glenn Puckett
Lexington, Ky

Last edited by removed037; 04-10-2006 at 05:21 PM.
 
Old 04-09-2006, 02:28 PM   #2
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Ok... Let me saee if my brain tubes are firing on this one:

2 DSL Connections
  1. Home DSL, Dynamic IP from ISP, cheap router for dhcp, etc
  2. Business DSL w/static IP assigned by ISP, using a switch, not a router. (5 IP addresses)
You want to use one of your business boxes as a gateway for your home internet (Therby eliminating the home DSL), correct?

The bus. box has 2 net cards. You want to connect home network thru business network to internet.

Am I right so far?

If so, no problem. But I may suggest a different setup for you, if that is true. Let me know if I'm correct. (I think you'll like it, and it'll be easy as pie)

Assign the router a static IP that was assigned by your ISP to one of your boxes. As far as the ISP would be concerned, it would only be one computer. Connect the WAN/Internet port of router to the business switch, and you're up and running with the home network on the business line. And you still have 4 more static IP's to go.
The hardware firewalls on most modems are not too bad, so...

You can actually connect all your computers behind the router, using the switch.

Example:

Internet DSL=>Router=>Switch=>All your PCs

You can then tell the router which IP address to send webserver requests to (port 80, ip address 192.168.1.180), which one for port 110 (ip address 192.168.1.110) All are only examples.
 
Old 04-09-2006, 02:36 PM   #3
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Your gateway settings are not correct but let's start at the beginning.
You cannot have 2 gateways. The gateway for the box above will be the ip address to which eth0 is connected. If you want to use the box to route to the internet then you will need install ip-masquerading and forwarding using iptables. You will find useful info on this here.
 
Old 04-10-2006, 09:17 AM   #4
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by cwwilson721
Ok... Let me saee if my brain tubes are firing on this one:

2 DSL Connections
  1. Home DSL, Dynamic IP from ISP, cheap router for dhcp, etc
  2. Business DSL w/static IP assigned by ISP, using a switch, not a router. (5 IP addresses)
You want to use one of your business boxes as a gateway for your home internet (Therby eliminating the home DSL), correct?

The bus. box has 2 net cards. You want to connect home network thru business network to internet.

Am I right so far?

If so, no problem. But I may suggest a different setup for you, if that is true. Let me know if I'm correct. (I think you'll like it, and it'll be easy as pie)

Assign the router a static IP that was assigned by your ISP to one of your boxes. As far as the ISP would be concerned, it would only be one computer. Connect the WAN/Internet port of router to the business switch, and you're up and running with the home network on the business line. And you still have 4 more static IP's to go.
The hardware firewalls on most modems are not too bad, so...

You can actually connect all your computers behind the router, using the switch.

Example:

Internet DSL=>Router=>Switch=>All your PCs

You can then tell the router which IP address to send webserver requests to (port 80, ip address 192.168.1.180), which one for port 110 (ip address 192.168.1.110) All are only examples.
Thanks for the feedback. But that's not my issue. I am simply trying to get BOTH interfaces working. Either one will work as long as the other is inactivated. But when both are activated the machine will only pass traffic on one of them. (Basically I test this using ping.) I'll take a new look at my initial post and try to make it a bit more clear.

I have found a link to a document that describes how to configure load balancing across two high speed connections. With all connections to the internal network going through a third network card. This is definitely NOT what I want to do. However, it does go into a description of using advanced routing to set up multiple interfaces. I'm not entirely sure advanced routing is what I need here but it appears closer than where I was.

I don't mind at all to do the reading needed to complete this. I just haven't been able to determine what is the right tools to use.

Thanks again....

Last edited by removed037; 04-10-2006 at 09:20 AM.
 
Old 04-10-2006, 05:16 PM   #5
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TigerOC
Your gateway settings are not correct but let's start at the beginning.
You cannot have 2 gateways. The gateway for the box above will be the ip address to which eth0 is connected. If you want to use the box to route to the internet then you will need install ip-masquerading and forwarding using iptables. You will find useful info on this here.
hmmmm..

I really didn't think this topic would be so difficult to make clear. I have several server class boxes that will be acting as web servers. The machines are on the DMZ and has each claimed one of the fixed IPs. That is all these machines will be doing. They will not be acting as a proxy or gateway or anything else for ANY of the machines on the internal network.

The three servers are in a converted walk-in closet in racks with all the routers, modems, switches, etc. There is not enough room to go in there and work on the machines. So I need to be able to connect to these machines from my home office through the internal network (it's much faster). I do have a monitor and keyboard hooked up through a KVM switch for times that I have VNC down, but there is no place to sit so I have to perform that work standing up.

I have a second network card in each machine that I want to use EXCLUSIVELY for connecting to that machine for support purposes. I need to connect via VNC to work on the machine. I also want to have Samba running so I can transfer files between the machines through the internal network. (My development machine is XP) I would prefer to set up that interface to ONLY allow those specific connections. I don't want the machine talking to the external network through the internal interface.

I do realize I gave more information than needed for this configuration in my original note. I was just trying to be as complete as possible in describing what I have.

I want to set up my machine such that eth0 is the primary/only interface to the external network. It will perform ALL activity through that interface. But I also want to set up eth1 so that it will accept traffic for VNC, Samba and any other services/ports necessary to support the machine itself.

So far I haven't even been able to get both interfaces functioning at the same time. Either will respond to a ping as long as the other is disabled. With both enabled only one responds to a ping. That is my first goal. Just getting that to work. I have even turned off the firewall just to see if it is what is causing the problem. It wasn't.

I have researched this for months and have tried many different configurations and command sets. So far nothing has gotten me past the simple fact that, except for brief periods, both interfaces refuse to work at the same time.

I really do appreciate the interest and input from the group. I hope someone soon can point me in the right direction.



Thanks
 
Old 04-10-2006, 06:16 PM   #6
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Sounds more like you want 'bridging'
 
Old 04-11-2006, 02:24 AM   #7
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Give all the boxes eth1 192.168.1.X addresses. Hook them up to a hub or switch box and define the names in /etc/hosts. Provided eth0 and eth1 are on differeent subnets you should be fine. I would suggest starting the ip numbers from 1 e.g. 192.168.1.1

Last edited by TigerOC; 04-11-2006 at 02:28 AM.
 
Old 04-11-2006, 06:04 AM   #8
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TigerOC
Give all the boxes eth1 192.168.1.X addresses. Hook them up to a hub or switch box and define the names in /etc/hosts. Provided eth0 and eth1 are on differeent subnets you should be fine. I would suggest starting the ip numbers from 1 e.g. 192.168.1.1
eth0 MUST use the fixed IP address from the business DSL through the DMZ. Something else is not an option. I can't afford a router that can handle multiple IP addresses. I've seen this setup a number of times in the windows envrionment. Surely it is more than possible using Linux.

Thanks for the try,

Glenn
 
Old 04-11-2006, 10:12 AM   #9
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally Posted by WGPuckett
eth0 MUST use the fixed IP address from the business DSL through the DMZ. Something else is not an option. I can't afford a router that can handle multiple IP addresses. I've seen this setup a number of times in the windows envrionment. Surely it is more than possible using Linux. Thanks for the try, Glenn
Then use a different private range like 192.168.0.X for the eth1 addresses. If you number the eth1 cards sequentially and hook them all on to a switch or hub then they can talk to one another on this lan. If you are purely communicating with each box and no external routing is necessary then you won't need a gateway. I have a similar setup with one box hooked to a modem/router and static ip hosting a webserver and then a number of boxes, including the server, hooked to a hub. I maintain the server remotely with KBear (ftp client) and Konqueror.
I have drawn a small diagram which you can see here.

Last edited by TigerOC; 04-11-2006 at 10:34 AM.
 
Old 05-01-2006, 10:43 AM   #10
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TigerOC
Then use a different private range like 192.168.0.X for the eth1 addresses. If you number the eth1 cards sequentially and hook them all on to a switch or hub then they can talk to one another on this lan. If you are purely communicating with each box and no external routing is necessary then you won't need a gateway. I have a similar setup with one box hooked to a modem/router and static ip hosting a webserver and then a number of boxes, including the server, hooked to a hub. I maintain the server remotely with KBear (ftp client) and Konqueror.
I have drawn a small diagram which you can see here.
Sorry it takes some time for me to reply. My new job has me severely limited in what I can work on my network. Which is getting me even further behind with what I need to accomplish.

Here is an image of the network I am trying to configure. Basically everything on the left side of the configuration (Servers) should talk to the internet through the business DSL. Everything on the right side of the configuration (Home/Office Computers) should talk to the internet through the aDSL. The three connections from the business machines to the switch in the middle should ONLY be used for VNC and shared files and, in the case of one of the business machines, shared printing. No traffic should go to the switch unless responding to connections from that side.

The Home/Office computers are fine. No problems there. I can't get the Servers to function properly at all. If I disable the network card connected to the switch then the machines work fine over the business DSL. If I disable the network card connected to the business DSL the servers talk to the switch appropriately. But when both network cards are enabled, one of them is ignored, typically the external connection (eth0).

On the Servers the yellow IP address represents the connection to the business DSL through eth0. The green IP address represents the connection to the internal network through the switch.

I want the servers talking to the internet through the eth0 connections and not handeling any sort of traffic from the internal network. They have their own path to the internet. I just want to be able to connect to the servers from my home office computer in order to support the web applications I have running on them. That minimizes the traffic on the "production" interface and gives me good responsiveness for VNC.

Are you saying that changing the three IP addresses on the servers from a 192.168.1.x address will fix the problem? I will give that a try as soon as I can manage the time. It would be nice to understand why that would make a difference.

Thanks for your input...

Glenn Puckett
 
Old 05-01-2006, 01:03 PM   #11
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Just looking at the diagram there is no reason why the setup should not be working correctly. The network addresses of eth0 and eth1 on the server side are on different subnets and this should not pose a normal resolution problem.
Can you clarify exactly what the modem does. Is it purely a connection with no routing or is there a router that performs address translation and if so on what range?
 
Old 05-14-2006, 09:40 AM   #12
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TigerOC
Just looking at the diagram there is no reason why the setup should not be working correctly. The network addresses of eth0 and eth1 on the server side are on different subnets and this should not pose a normal resolution problem.
Can you clarify exactly what the modem does. Is it purely a connection with no routing or is there a router that performs address translation and if so on what range?
Thanks for your reply.

I do not have a router between the servers and the internet. The servers are connected to a network switch that is connected directly to the dsl modem. Therefore they have the ability to grab the specific fixed ip address allocated by the business ISP without any filtering or translations happening in between.

On the other side I have a dsl router connected to the dsl modem. This way I can use the internal firewall built into the router. Basically I allow very little traffic to enter my home office network outside that of active connections initiated by a web browser, ftp tool or similar function on the home office machines.

I have a mix of fixed ip addresses and dhcp assigned addresses on the home office side.

My final configuration will be to not allow the servers to initiate any traffice through the internal facing interfaces. They will only be able to respond to incomming traffic from my home office machines. And then only to specific activity, ie VNC and SMBA. Hopefully this will prevent any further polution of my internal machines should a virus make it past the firewall into a specific machine. The servers will also have a very specific configuration for how they talk to the internet based on the services that I am using for web pages, etc.

I just need to get past this issue of getting both interfaces to work at the same time.

Last edited by removed037; 05-14-2006 at 09:54 AM.
 
Old 05-14-2006, 11:29 AM   #13
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Why does this happen?

This is an example of what is going on with my servers that I just can't understand.

I had the external interface (ent0) enabled and the internal interface (eth1) disabled. I wanted to use VNC so I went in and reversed that on the server and rebooted. Also I changed eth1 to "Trusted" on the network configuration so it would bypass my current iptables rules.

At that point I could access the server through VNC but eth0 was not functional. I wanted to check some settings with both interfaces activated so I brought the Network Configuration tool back up and activated eth0.

Just for grins I attempted to ping the server through eth0 and it actually responded. At this point the server is actually allowing traffic on both eth0 AND eth1.

I decided to reboot the server and see what happens. I didn't change anything. I just rebooted. Now the server no longer responds to a ping to eth0.

In checking the settings I see one thing that changed. After I activated eth0 "netstat -r" returned

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
64.191.162.29   0.0.0.0         255.255.255.248 U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         64.191.162.30   0.0.0.0         UG    0      0        0 eth0
After the reboot the same command returned.

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
64.191.162.29   0.0.0.0         255.255.255.248 U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
Notice on the last line that the gateway address had changed. That appears to be the key here. It seems to me I need to configure the system to know which gateway to use for each interface. How do I do that?
 
Old 05-14-2006, 12:55 PM   #14
removed037
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Original Poster
Rep: Reputation: 0
A step forward

I finally came across something and gave it a try.

Since it appears that I MUST use the gateway for the external interface I have been trying to find a way to force the external interface's gateway address.

I have updated /etc/sysconfig/network with the following 2 lines:

GATEWAY=64.191.162.30
GATEWAYDEV=eth0

And rebooted. Now I can connect to the server from my home office machine through the internal interface (eth1) and the server will respond to a ping on the external interface (eth0).

So now I am past this issue (took 9 months). The next step is to finally get my firewall configured the way I want and then I will be ready retest. Hopefully I am now past all this mess!!!!

Thanks to everyone's interest and suggestions.

Glenn Puckett
 
  


Reply



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
effective utilisation of dual internet connections. exodist Linux - Networking 1 03-07-2006 10:41 PM
network connections in taskbar abattoir Linux - Networking 1 02-25-2005 06:41 PM
Network Connections RedRaven Linux - Networking 6 12-19-2004 11:19 PM
Dual broadband connections and linux? tekhead2 Linux - Networking 1 08-08-2004 05:26 PM
2 network cards, 2 network connections - routing problem tvojvodi Linux - Networking 4 02-24-2004 03:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration