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-20-2011, 03:18 PM   #1
cbr900rrw
LQ Newbie
 
Registered: Apr 2011
Distribution: Ubuntu Desktop 10.04
Posts: 2

Rep: Reputation: 0
Configuring 2 NIC's on Ubuntu Desktop 10.04


Ok first off, I've sifted through alot of internet threads on this but no-one seems to have the complete answer. I am a relative novice by my own admission and descriptions in 'Laymans terms' are welcomed. Ultimately I don't just want to get this sorted, I want to understand the 'Why' as well as the 'how'. Thanks in advance!

Ok, so I have 2 pc's at home, neither v flashy but both more than capable of running this. Previously I had them both running XP SP2. One pc has 2 NICs in it and the second only one. So, PC1 (now running Ubuntu desktop 10.04) has the 2 NICs installed ...

1) A realtek NIC which is on 'eth1' and from which I receive internet connectivity from the router of this shared house. (2 other people connect their PCs to the internet via this router.)

2) A 3com NIC on 'eth0' which I have connected (using a crossover cable) to the Intel 'PRO100 VM' NIC on PC2.

Admittedly this took me some time to get half working. Currently I can connect to the internet through 'eth1' OR to PC2 via 'eth0' BUT NOT AT THE SAME TIME. However, If I disconnect one (by left clicking on 'disconnect' under the top of screen menu bar, then the other one will immediately work ... and visa versa.

I had this working when both PC's were running windows XP but now in trying to educate myself further I have installed Ubuntu on PC1 and am attempting the same thing. I refuse to accept that as alot of these thread responses state, that it 'can't be done'. Quite clearly it can be done since the physical connections and hardware are no different, its just about ensuring that the protocols are all correct and that I haven't done something stupid.

I am very keen to learn more about computer networks and equally keen to educate myself in the ways of Linux, in fact I am studying to gain a network qualification as we speak but at this stage its still a little confusing. I have learned an awful lot about the fundamentals of networking but the 'hands on stuff' is where I really need to test myself.

Anyone that thinks they have the definate answer I would be very pleased to hear from. I am sure there are questions that you might want to ask to establish some more of the facts so please feel free, I will get back to you as soon as I can.

Many many thanks. Please help me to understand 'why'

regards

John

Last edited by cbr900rrw; 04-20-2011 at 03:19 PM.
 
Old 04-20-2011, 03:35 PM   #2
sibe
Member
 
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21
Hi,

if you have established connection in either way, then the physical configuration is ok. To get a clearer perspective on this issue, can you put in here your Ubuntu and Windows IP configuration?
 
Old 04-20-2011, 03:51 PM   #3
Pygobombe
LQ Newbie
 
Registered: Aug 2004
Location: Canada
Distribution: ubuntu, opensuse, freebsd, osx. (and a few others from time to time)
Posts: 14

Rep: Reputation: 0
Well, one of three ways could work for you.
The linux box hasn't been told that it needs to route traffic from one interface to the other.
1) use a seperate /24 network and route the traffic.
2) use iptables and NAT for your windows box.
3) create a bridge of the two interfaces (eth0 and eth1 act as two ports on a switch)

I'd say option two or three are easiest.
Option 3 will allow your windows PC to communicate with other computers on the network from your router. Personally though I prefer to have my network separate from others in case of viruses/worms/etc so I would go for option 2. You should be able to use iptables with option 1 as well to filter out unwanted traffic.

Like Sibe suggested, we'd like an output of what you have for networking. I don't want to go taking the time to make two or three different configurations for you since you're probably only going to pick one.
Though I have to admit I've not tried doing option 3 before, but from what I've read it looks quite easy. bridgeutils is what we'll be using if you want to look into it.

Oh and there is a secret fourth option. Install virtualbox on your linux box, add the two interfaces into a virtualmachine in bridged mode (so it gets to use them as well as your host linux box.) And install pfsense (or your other favourite firewall distro) and use that.
 
Old 04-20-2011, 03:56 PM   #4
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 215

Rep: Reputation: 66
My "guess" is that you can only get to one or the other is because of a routing issue which is using the default gateway.

Again this is only a guess because I have limited information.


eth1 has a default gateway pointing to your router which the machine is using as the "default gateway". So when you try to go out to PC2 it is trying to go through the default gateway which is the other NIC.

I hope I explained that correctly.

can you post the output of the following commands:

ipconfig -a

and

route
 
Old 04-20-2011, 06:38 PM   #5
cbr900rrw
LQ Newbie
 
Registered: Apr 2011
Distribution: Ubuntu Desktop 10.04
Posts: 2

Original Poster
Rep: Reputation: 0
Hi and thanks very much for the responses!

It is something fairly elementary I have got wrong I am sure, you will probably be able to tell me from the following (requested) information exactly what I have failed to understand.

PC1 (Ubuntu 10.04) - what I get if I type ifconfig -a ...

eth0 Link encap:Ethernet HWaddr 00:06:5b:73:1f:a3
inet6 addr: fe80::206:5bff:fe73:1fa3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2297 errors:0 dropped:0 overruns:0 frame:0
TX packets:1882 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:692031 (692.0 KB) TX bytes:325630 (325.6 KB)
Interrupt:18 Base address:0xe800

eth1 Link encap:Ethernet HWaddr 00:06:4f:29:5e:53
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::206:4fff:fe29:5e53/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:68185 errors:0 dropped:0 overruns:0 frame:0
TX packets:44456 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:90670323 (90.6 MB) TX bytes:4768636 (4.7 MB)
Interrupt:16 Base address:0xdc00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1225 errors:0 dropped:0 overruns:0 frame:0
TX packets:1225 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:101488 (101.4 KB) TX bytes:101488 (101.4 KB)

Also, under 'Connection Information' ...

Interface: Ethernet (eth1) - Internet connection from router
Hardware Address: 00:06:4f:29:5e:53
I.P Address: 192.168.1.255
SubN Mask: 255.255.255.0
Default Route: 192.168.1.254
Primary DNS: 192.168.1.254

Interface: Ethernet (eth0) - The Crossover Cable link to PC 2
Hardware Address: 00:06:5b:73:1f:a3
I.P. Address: 192.168.1.101
Broadcast Address: 192.168.1.255
SubN Mask: 255.255.255.0
Primary DNS: 192.168.1.254

Finally,PC2 (win xp) gives the folowing:

IP Address: 192.168.1.111
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.101
Prefd DNS Server: 192.168.1.254

Rather than automatically, I entered all this manually. As i said, i want to understand what is going on and why, not just how to make it work.

'Eth1' I set the IPv4 to 'Automatic (DHCP) but in trying to put into practice what I thought I had recently got a grasp of I manually input IPv4 Eth0 info. I had set them both to automatic I recall, but that left me in the same boat. ie. If I don't disable one of them then neither works.

I notice though that when I click on 'edit connection' for the 'LAN' (Crossover link) NIC, that the 'Gateway is listed as 0.0.0.0 and I am pretty sure I entered the IP of the main router into this (192.168.1.254). Does the fact that it has cleared itself suggest that that is where a potential conflict might lie.

I think I am understanding the concept, its just the fine tuning, hopefully you can read into this information exactly what it is I have failed to understand.

Once again, thank you very much for your time and patience.

John
 
  


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
ubuntu-desktop vs. kubuntu-desktop vs. xubuntu-desktop vs. lubuntu-desktop vs. unity Kenny_Strawn Ubuntu 18 05-13-2011 09:20 AM
Configuring Two NIC in ubuntu 9.4 Desktop edition vinay_ks Ubuntu 2 06-29-2010 05:27 AM
Configuring multiple desktop on Ubuntu rob2006 Linux - Laptop and Netbook 3 05-25-2010 12:32 PM
Ubuntu Desktop Install Freezes at 90% "Configuring Hardware" ... TelQuel Ubuntu 4 06-05-2008 05:38 AM
Configuring Nic chalichalupa Linux - Networking 6 01-13-2004 02:47 AM

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

All times are GMT -5. The time now is 06:26 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