LinuxQuestions.org
Help answer threads with 0 replies.
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 09-13-2005, 04:59 PM   #1
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Rep: Reputation: 15
fun dual network stuff


alright, i have two networks in this house i'm living in, and want to set up a fileserver to serve both networks. I have the server here, am familiar with linux, and used this server at home for a while before bringing it here. it is currently working on the first network listed below.

I tried configuring this on my own, and came really close, but some weird things would happen when both networks were connected at once, so i'm looking for a real procedure to do this, so i can find whatever oversight(s) i made. The server is restored to being configured for only the first network, and it works perfectly. Both networks use a flavor of linksys router, with which i'm very familiar (configured tens of them over the years, used them at home and work for 4 years or so)


Network 1: currently working
uses static IPs
gateway is 192.168.0.1
subnet mask 255.255.255.0


Network 2: not configured or anything
uses DHCP
gateway is 192.168.1.1
all other default linksys network stuff which i'm sure you're all familiar with

Both NICs are integrated into the motherboard of the server and work fine. I won't bother explaining the weird things that happened when i was configuring them on my own, because i'm sure it was just a mistake or oversight i made.

So i have samba, http, ftp, ssh, and all other kindsa stuff working on the first network fine, and at the very least i want samba working on the second network. I had this working, but the second network connection interfered with all kindsa other stuff that was supposed to work on the first network.

Ideally, all of those services would work on both networks.

I'm familiar with /etc/network/interfaces and i'm sure i can handle whatever else you throw at me, but I'm incredibly anxious to get this working, esp after spending about a week googling, configuring, and doing some experimenting as well.

The server is running debian, and, as i said, it is retroconfigured to just the first network and is fully functional

help! (and thanks)


edit: both networks have active internet connections, and I guess I would somehow need to specify the default network to use for outgoing internet stuff, so i figured you should know that.

Last edited by FliesLikeABrick; 09-13-2005 at 05:00 PM.
 
Old 09-13-2005, 06:45 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Hi.

It sounds like you need to define the default interface for the 192.168.1.0 network on the server.

Assuming the 192.168.0.0 network is on eth0 and the 192.168.1.0 network is on eth1, try doing :

route add -net 192.168.1.0 eth1

That should route any outgoing packets for the .1 subnet through eth1.

Post the output of 'route' if that doesn't work.

Dave

Last edited by ilikejam; 09-13-2005 at 06:49 PM.
 
Old 09-13-2005, 06:54 PM   #3
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Original Poster
Rep: Reputation: 15
i would configure eth1 as normal in /etc/network/interfaces as normal, correct? aka i would add the line:
iface eth1 inet dhcp

to my /etc/network/interfaces, then perform the route command you described?

btw, i want to use eth0 for my primary outgoing, but i get the idea.

Anyone else, feel free to contribute in case this doesn't work
 
Old 09-13-2005, 07:08 PM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Hmmm. I'm not familiar with /etc/network/interfaces (it's all RedHat style at my end).

If that's the way you would normally get a DHCP interface up and running, then yes, I'd do that. Once the interface is up (and assigned an IP address etc), post the output from 'route' and we'll see what DHCP has decided to do to the routing tables.

Dave
 
Old 09-13-2005, 07:47 PM   #5
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Original Poster
Rep: Reputation: 15
hmm

server3:/mnt/external250# route add -net 192.168.1.0 eth1
SIOCADDRT: Invalid argument


after that failed, i ran route just to see what was in there:

server3:/mnt/external250# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0




wanna tell me what that means? I have a feeling there shouldn't be two records there, but thats just a guess (or at least not two using the same interface)

Last edited by FliesLikeABrick; 09-13-2005 at 07:48 PM.
 
Old 09-13-2005, 07:55 PM   #6
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
OK, eth1 isn't up. Try:

ifconfig eth1 up
dhclient eth1

Once dhclient finishes what it's doing you should have both ethernet devices up, and both should have an IP address. You can check this by running 'ifconfig'.

The two records for eth0 are OK: the:
'192.168.0.0 * 255.255.255.0 U 0 0 0 eth0'
line means anything destined for the 192.168.0.0 subnet should go through eth0 (which is fine).
The:
'default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0'
line means any packets for subnets which aren't known about should go through eth0 to the default gateway, which is 192.168.0.1. (Which is also fine).

Dave

Last edited by ilikejam; 09-13-2005 at 08:00 PM.
 
Old 09-13-2005, 07:56 PM   #7
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Original Poster
Rep: Reputation: 15
ah didnt know that eth1 had to be up in order to add it to the routing table

edit: i still get the same error when i try to use the route command

Last edited by FliesLikeABrick; 09-13-2005 at 07:57 PM.
 
Old 09-13-2005, 08:01 PM   #8
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
What do you get when you run 'ifconfig'?
 
Old 09-13-2005, 08:05 PM   #9
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Sorry, my mistake. Try:

route add -net 192.168.1.0 netmask 255.255.255.0 eth1

Then post the output of 'route'.

Dave

Last edited by ilikejam; 09-13-2005 at 08:06 PM.
 
Old 09-13-2005, 08:37 PM   #10
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Original Poster
Rep: Reputation: 15
server3:/mnt/external250# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0



it took a good 20 seconds for the last 2 lines, then the last one to appear, not sure if that means anything


ifconfig yields:

server3:~# ifconfig
eth0 Link encap:Ethernet HWaddr 000:A8:00:B0:1B
inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:a8ff:fe00:b01b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3607179 errors:0 dropped:0 overruns:0 frame:0
TX packets:3632082 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2888764292 (2.6 GiB) TX bytes:535694442 (510.8 MiB)

eth1 Link encap:Ethernet HWaddr 000:A8:00:B0:1C
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:a8ff:fe00:b01c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27 errors:0 dropped:0 overruns:0 frame:0
TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8510 (8.3 KiB) TX bytes:11366 (11.0 KiB)

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:108 errors:0 dropped:0 overruns:0 frame:0
TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:10184 (9.9 KiB) TX bytes:10184 (9.9 KiB)

Last edited by FliesLikeABrick; 09-13-2005 at 08:39 PM.
 
Old 09-13-2005, 08:59 PM   #11
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
OK. You want to get rid of 'default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1' as there should only be one default route.

Do 'route del default gw 192.168.1.1'

Once that's done, try pinging 192.168.1.102 from a machine on the 192.168.1.0 subnet. If that works, your network should be OK from a TCP/IP point of view.

For completeness, you could do:
route del -net 192.168.1.0 netmask 255.255.255.0 eth1
to get rid of one of the duplictate '192.168.1.0 * 255.255.255.0 U 0 0 0 eth1' lines.

Basically, what you want to end up with is:
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

Dave

Last edited by ilikejam; 09-13-2005 at 09:03 PM.
 
Old 09-13-2005, 09:06 PM   #12
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Original Poster
Rep: Reputation: 15
looks good. i hope you're subscribed to this thread because if i encounter any more problems tonight or in the next couple days, this thread is where i'll be posting

edit: except i still have some duplicate records in my route table

server3:/mnt/external250# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0


edit again: now i restarted and its all different... and it doesnt work right. i don't think any normal outgoing connections from the server are working at all


server3:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

Last edited by FliesLikeABrick; 09-13-2005 at 09:18 PM.
 
Old 09-13-2005, 09:22 PM   #13
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Cool. I edited my last post just before you posted there, so you may not have seen the bit about removing the duplicate lines. It shouldn't make any difference though.

P.S. You should probably statically assign the server IP addresses for *both* interfaces, and configure the router on the .1.0 subnet (which is doing DHCP) to reserve the IP address for eth1, so that you don't have to look up which IP address that has been assigned to your server. Not strictly speaking necessary, but it should make things easier should you have to reboot the server.

Dave

Last edited by ilikejam; 09-13-2005 at 09:25 PM.
 
Old 09-13-2005, 09:24 PM   #14
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Heh. Edits all round.

You'll have to remove the 'default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1' line from the routing table with 'route del default gw 192.168.1.1'. That's what's causing problems.

Dave
 
Old 09-13-2005, 09:25 PM   #15
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Original Poster
Rep: Reputation: 15
well unfortunately this server will probably get reset relatively often, and i definately need it to work from boot. so what does the routing table ideally need to look like to survive a reboot, and what else do i need to do to survive a reboot?

edit: ok, i removed the default line for 192.168.1.1, i figured that was what was causing the problems. but how do i keep this from coming back on reboot?

Last edited by FliesLikeABrick; 09-13-2005 at 09:26 PM.
 
  


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
fun stuff - most helpful user recently titanium_geek LQ Suggestions & Feedback 8 06-22-2005 11:58 AM
Fun stuff we've installed Kroenecker Linux From Scratch 2 10-08-2004 06:03 AM
add your fun quotes and stuff Mattentaart General 16 05-05-2004 05:24 PM
fonts, desktop customization, fun stuff = newb here. spiffdoodle Linux - Newbie 6 02-25-2004 11:05 PM
linux fun stuff punt Linux - General 14 08-30-2001 08:57 AM


All times are GMT -5. The time now is 06:45 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration