LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-15-2005, 01:28 AM   #1
dasbooter
Member
 
Registered: Mar 2005
Posts: 122

Rep: Reputation: 15
3rd nic in a Suse Box running as a router


I understand this configuration is common:
Code:
internet<--(1rst nic)Suse router box(2nd nic)<--switch<--2 computers
however I have and extra nic available instead of the switch so I wondered if it were possible to get this configuration working and if you could dumb it down for me that would be great more of a Suse newbie than a Debian guru if you know what I mean:
Code:
internet<--(1rst nic)Suse router box(2nd nic)<---1rst computer
                                    (3rd nic)<----2nd computer
Thanks in advance
 
Old 07-15-2005, 06:19 AM   #2
fouldsy
Senior Member
 
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
Theoretically, yes, you should be able to, as I had a Shuttle acting as a router as a temporary measure setup by our ISP that was just a Linux box with two internal nic's for a curriculum and admin networks to be fed in separately and then one external connection to the fibre.

Why do you want to remove the switch though? I'm not sure about the exact details but shouldn't be too hard - give the 2nd + 3rd IP addresses that point through to the first nic as default gateway and the routing table to handle the two machines on the other side should be done automatically, though you might need to stick a route in telling the SuSE box which device to use.
You'd also then need different network cables (crossover rather than straight-through) from your 2nd+3rd nic's to the computers, so may well be more hassle than it's worth. If you need to an extra machine for some reason in the future you couldn't simply plug into the switch so you limit further expansion too.

Maybe someone can recommend the exact config for you routing table and ip tables for the masquearding + forwarding...
 
Old 07-16-2005, 02:52 PM   #3
dasbooter
Member
 
Registered: Mar 2005
Posts: 122

Original Poster
Rep: Reputation: 15
Well you see I acutally dont own a switch but do own an extra nic and so I was trying to be frugal and actually use what was on hand. My attempts so far have been unsuccesful with only one box being able to connect to the suse router box and not both at the same time. I have tried troubleshooting in various manners but I am sort of coming to the conclusion that in fact my ignorance of networking is the problem. I think perhaps that I will require a network bridge in the suse router between the two nics that are connected to the 2 internal systems.
 
Old 07-16-2005, 02:59 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
That's like shooting the floor, man.

The simplest way:

Set two different networks for the inner interfaces. say:
eth1 network: 192.168.1.x
eth2 network: 192.168.2.x

Set two IPs for both interfaces... say:
eth1: 192.168.1.1
eth2: 192.168.2.1

Set the IPs of the client machines
Machine connected to eth1: 192.168.1.2 netmask 255.255.255.0 gw 192.168.1.1
Machine connected to eth2: 192.168.2.2 netmask 255.255.255.0 gw 192.168.2.1

That will make it possible for both mahcines to reach the router and viceversa /try pinging).

To make it possible to reach both clients from themselves, you have to maek sureforward is enabled in the router... and the firewall stuff.
Try pinging between them.

Make sure the netmasks are right... otherwise, it won't work.

The other simple way is bridging... but I have never tried.. maybe you could give it a shot.
 
Old 07-17-2005, 09:54 AM   #5
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
Like eantoranz suggested, to use the two network cards you either need to assign them different IP subnets (the 192.168.1.x and 192.168.2.x, also the Internet connection needs to be unique to both of these, so make sure if you have a DSL or Cable router, it is on a different IP range also) or bridge the two connections. If you put them on different subnets, you basically need one full set of IPTABLES rules for each interface and then more rules if you want to open connections between the two.

FYI in Oregon, USA I can find stores that sell cheapo $5.00US switches, which isn't much considering cables are a couple dollars apiece anyhow and you will need special crossover cables if you connect NIC to NIC.

Aside from that, you mentioned you had one working so if it's still not all going it may help to post more info like what IP addresses and/or firewall script you are using now.
 
Old 07-20-2005, 11:29 AM   #6
dasbooter
Member
 
Registered: Mar 2005
Posts: 122

Original Poster
Rep: Reputation: 15
Well I finally accomplished this task via a bridge.
The network was not functional eg. IP masquerading etc for the two boxes that were attaced to the two nics in the router box. The configuration that was suggested that simply assigns two different IPs and the same netmask allowed one box and not the other to connect to and use the router box to contact the internet.

Just to review the Suse router box has three network interface cards one connected to the external (hostile/internet) and two others (internal/friendly), these are each connected to another box/system each with its own nic(onboard the MOBOS in this cae).

I used bride-util available thru Yast add remove software and then again thru Yast assigned each of the internal cards an ip of 0.0.0.0
.Make sure under Security---> Firewall that the two cards in the Suse router box that will be connected to your 2 other systems are assigned to internal interfaces.

Now open your terminal program of choice as root and do :
Code:
dasbooter@fatman:~>brctl addbr br0
builds the bridge
Code:
dasbooter@fatman:~>brctl addif br0 eth0
Code:
dasbooter@fatman:~>brctl addif br0 eth1
adds the two intenal network cards to be bridged to the bridge
then do this:
Code:
dasbooter@fatman:~>ifconfig eth0 down
dasbooter@fatman:~> ifconfig eth1 down
dasbooter@fatman:~> ifconfig eth0 0.0.0.0 up
dasbooter@fatman:~> ifconfig eth1 0.0.0.0 up
just makes sure but you probably dont have to do this
then finally
Code:
dasbooter@fatman:~>ifconfig br0 192.168.0.1 up
Now try pinging the router box and pinging the 2 internal machines from the router box if that doesnt work that drop the firewalls for a moment and try again. If that doesnt work then your screwed cause I am fresh out of ideas Make sure IP masquerading is checked in Yast firewall and you should now have access to the internet from the 2 internal machines. Now to make it permanent?
which exposes another weakness of mine scripting and run level knowledge

Good resources http://www.tldp.org/HOWTO/Ethernet-B...O-3.html#ss3.1 http://bridge.sourceforge.net/
**** I did this because I had all the materials on hand cables and nic cards and wanted to save a couple of bucks and learn something in the process. I dont doubt that there are others who collect computer junk just like me ****

Last edited by dasbooter; 07-20-2005 at 11:31 AM.
 
  


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
2 External Nic, 1 Internal Nic Router Problem trevanda Linux - Networking 0 10-13-2004 01:20 AM
Another Suse 9.1 + router/NIC problem neofile Linux - Networking 24 07-27-2004 09:18 AM
Dual NIC router for SUSE 9.0 R Audano Linux - Networking 4 03-09-2004 02:11 PM
Can ping box to box thru router - good sign? toastermaker Linux - Networking 15 12-07-2003 12:00 AM
Running Maya 5.0 on Mandrake 9.1 (with ATI Radeon 3D 3rd Part Driver too!!) visjes Linux - Software 1 07-22-2003 03:12 PM

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

All times are GMT -5. The time now is 02:45 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration