LinuxQuestions.org
Review your favorite Linux distribution.
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 01-29-2007, 03:39 AM   #1
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Rep: Reputation: 30
1 Linux Box 3 NIC problem


- hey guys i setup 3 NIC in our UBUNTU eth0 is configured for our DSL internet connection eth1 is configured for our LAN and uses 192.168.0.1. our windows networks uses 192.168.0.2 and so on... i installed a 3rd NIC in our UBUNTU and uses 192.168.0.36 and so on for a second windows network. Both eth1 and eth2 are different windows network. may goal here is to use the UBUNTU linux to access files from both different networks. but there is a problem i use 192.168.0.40 in the eth2 interface and tried to ping 192.168.0.36 but an error shows up saying not permitted. then other problems was experienced the contents of the UBUNTU network servers can be displayed and computers using the eth1 as gateway to the internet can no longer access the net.pls help me out here
 
Old 01-29-2007, 04:04 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
What subnet mask are you using for eth1 and eth2? Actually, could you post the ifconfig output for each NIC?

If I had to guess right now, I'd say you're trying to put two NICs on the same subnet, which is not going to work.
 
Old 01-29-2007, 09:27 AM   #3
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
- yes actually both eth1 and eth2 uses the same subnet (/24). so how do i properly connect 2 LAN in our UBUNTU box?
 
Old 01-29-2007, 02:26 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by SBN
- yes actually both eth1 and eth2 uses the same subnet (/24). so how do i properly connect 2 LAN in our UBUNTU box?
Either divide them into separate subnets, or turn eth1+eth2 into a bridge.

If the networks are separate, it seems that the easiest thing to do would be to divide up 192.168.0.0/24 into 192.168.0.0/25 and 192.168.0.128/25. That will require re-IPing some of the clients, though (in addition to one interface on the Linux box, and changing the subnet masks of both).

Making a bridge wouldn't require a change for the clients, but it's more difficult to configure on the Linux box.
 
Old 01-29-2007, 07:38 PM   #5
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
-ok so the new setup would now be eth1 using 192.168.0.0/25 and eth2 using 192.168.0.0/25 or eth1 is 192.168.0.0/24 and eth2 192.168.0.0/25...or could be possible to just set eth1 to use 192.168.0.0/24 and eth2 192.168.1.1/24...
 
Old 01-29-2007, 10:00 PM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by SBN
-ok so the new setup would now be eth1 using 192.168.0.0/25 and eth2 using 192.168.0.0/25 or eth1 is 192.168.0.0/24 and eth2 192.168.0.0/25...or could be possible to just set eth1 to use 192.168.0.0/24 and eth2 192.168.1.1/24...
Apparently you didn't look very closely at what I typed.

192.168.0.0/24 split in half becomes:

192.168.0.0/25
AND
192.168.0.128/25

Those are two different networks. A /25 is one half of a /24 network (and thus the second half starts at 256/2 = 128).

Probably the easiest thing to avoid confusing you would be do put
eth1 subnet = 192.168.0.0/24, eth1 ip somewhere between 192.168.0.1 and 192.168.0.254
eth2 subnet = 192.168.1.0/24, eth2 ip somewhere between 192.168.1.1 and 192.168.1.254
 
Old 01-30-2007, 12:09 AM   #7
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
- sory i was just confused by the CIDR i thought if you devide 192.168.0.0/24 their CIDR is still /24.
- i think i will try the one that you suggested.

Quote:
eth1 subnet = 192.168.0.0/24, eth1 ip somewhere between 192.168.0.1 and 192.168.0.254
eth2 subnet = 192.168.1.0/24, eth2 ip somewhere between 192.168.1.1 and 192.168.1.254
-if i do this are they is there anything more i should configure for it to work.
 
Old 01-30-2007, 01:51 AM   #8
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by SBN
-if i do this are they is there anything more i should configure for it to work.
Yes. You need to make sure that whatever machines are connected to eth1 and eth2 have the appropriate subnet mask and IP address for the network they are on. If you're using the Linux box for those other machines to reach the Internet, you need to make sure their default route properly points to the IP address of the interface on the Linux box that they are connected to.
 
Old 01-30-2007, 07:29 PM   #9
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
- i have configured eth1 to 192.168.0.1/24 and eth2 to 192.168.1.1/24. so far there are no problems but i cant ping any ip address from 192.168.1.1/24 there is an error saying operation not permitted..
 
Old 01-30-2007, 07:49 PM   #10
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by SBN
- i have configured eth1 to 192.168.0.1/24 and eth2 to 192.168.1.1/24. so far there are no problems but i cant ping any ip address from 192.168.1.1/24 there is an error saying operation not permitted..
This is from machines connected to that interface? Is there gateway (default route) set to 192.168.1.1? It needs to be set to that if you want machines on that network to route through the Linux box.

Are you running a firewall on the Linux box? What's the output of
Code:
# iptables -L
?

If you want to allow machines from one network talk to the other, you also need to enable IP forwarding.
 
  


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
box with 2 NICs, another with just 1 NIC TheOneAndOnlySM Linux - Networking 2 08-29-2006 09:36 AM
Getting my DSL box to connect through a NIC on a windows box Tuxman8898 Linux - Networking 1 01-30-2006 06:40 AM
Problem getting Internet on dual-NIC Slack 10.1 box Staedtler Slackware 21 07-11-2005 08:53 PM
I have problem with installing ISA NIC on a slackware8.0 box senthilkumaran Linux - Hardware 1 12-20-2003 10:35 AM
One linux box and nic card, two high-speed internet connections ajnunes Linux - Networking 3 10-24-2002 04:34 PM

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

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