LinuxQuestions.org
Help answer threads with 0 replies.
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 06-15-2003, 12:15 AM   #1
bruce1271
Member
 
Registered: Apr 2003
Location: Dallas, TX
Posts: 122

Rep: Reputation: 15
Advice on Gateway and IP address


For a few years I have been using 2 ethernet cards in my linux machine. 1(eth0) connects to my ISP;2(eth1) connects to a 10mb hub which has 2 windows pc's connected to it. eth1 has an assigned IP of 192.168.0.1.

I use 192.168.0.1 as my gateway to the internet when configuring my windows pc's.

Like I said everything has worked great..until now. I want to bail on the hub and put a 10/100Mbs switch in its place. I found a good deal on a netgear MR814 Router/Switch/wireless AP.
When I take a look at the settings for thie switch it uses an IP of 192.168.0.1(same as my eth1) and gateway of 19.168.0.1. So I changed my linux IP address to 192.168.0.2.

Now when I configure my windows, do I use 192.168.0.2 or 192.168.0.1 as my gateway?

Also, the connection to this switch is spotty. I can ping then it dies(few secs later). I am using a cheapo linksys 10/100 card in my linux. Anyone think this may be the problem?
thanks
 
Old 06-15-2003, 01:04 AM   #2
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
The MR814 is a router, which, up to now, your linux box was. Typically, one puts the router between all computers and the ISP. However, if you want to have uninterrupted access for your linux box, you'll have to set up NAT and PAT on the router, open up a DMZ on the router, or put the linux box between the ISP and the router. You could set your linux box to be a router (say on the 10.0.0.0 network), and give the netgear router an "external" IP address of 10.0.0.2 and an internal IP address of 192.168.0.1 (your linux box's second ethernet card would be 10.0.0.1).
If the linksys 10/100 card was working with the hub, I'd suspect the router. . .
 
Old 06-15-2003, 06:27 AM   #3
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
there is an easier way. You can use the thing as just a switch (a managed one at that). You can disable the DHCP server in the switch and connect it to the Linux box via the Uplink port (i think this has to be done using a crossover cable, i'd call netgear tech support). That way, you can use it as just a switch and not have to have it setup as 2 routers. It would be like the hub, only its managed (it has an IP) and its faster. Best way to find out how to set it up is to either check out the manual or call netgear. Atleast it worked for me calling Linksys, their tech support is pretty good, i think netgear probably offers the same.


edit:

if you do thist, the gateway will still be the linux box and everything can still be on the same subnet. (192.168.0.X or whatever)

Last edited by Robert0380; 06-15-2003 at 06:28 AM.
 
Old 06-15-2003, 09:26 AM   #4
bruce1271
Member
 
Registered: Apr 2003
Location: Dallas, TX
Posts: 122

Original Poster
Rep: Reputation: 15
Thanks for the replys. Happy Fathers day to all the Dads out there.

The MR814 can be a router or a switch. Also, it can be wired or wireless. So It is 4 peices of equipment in one. I only want to use the switch as wired right now.
I did disable DHCP and tried to set it up as a lan switch, but the Linux box comm is iffy. I did plug the linux box into the regular port of the switch(not the ISP port). I thought the switch would act like two PC's talking to each other.

2 weeks ago I gought a plain CompUSA switch(with no router) and I had the same problems with the connection to my linux using that switch. So, I am tempted to change my linksys ethernet card out. I tried setting to Full duplex etc using mii-tools but no help. It would ping 3 then stop for 10 then ping 2 then stop. It was intermittent...strange.

Any advice?
 
Old 06-15-2003, 07:49 PM   #5
bruce1271
Member
 
Registered: Apr 2003
Location: Dallas, TX
Posts: 122

Original Poster
Rep: Reputation: 15
Well,
I got it working.
The main issue was the cable believe it or not. I finally used the given patch cable form netgear and the connection from my linux to the router/switch worked. Of course I had to set-up the router to act like a switch.
To do this, I Set the internet address as 192.168.0.1. The I disabled dhcp. I then went into lan settings and changed the Ip address of the router/switch to 192.168.0.2 and used 192.168.0.1 as my gateway and everything seems to be working at 100Mbs full duplex.

Thanks to all who gave advice.
 
Old 06-17-2003, 08:38 PM   #6
bruce1271
Member
 
Registered: Apr 2003
Location: Dallas, TX
Posts: 122

Original Poster
Rep: Reputation: 15
Now it is broke again

Well,

If it aint broke dont fix it. I upgraded the firmware to the latest stuff released in may and now it wont accept my configuration.

It says"LAN and WAN cannot have the sam subnet"

Obviously I have them both on 255.255.255.0 because I want linux to supply the internet to the switch, but I also want my Windows PC's to tlak freely with Linux.

Anyone know how I can get around this?
 
Old 06-17-2003, 10:03 PM   #7
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
255.255.255.0 is not a subnet, it's a broadcast. 192.168.0 is your subnet. You either have to turn off the routing on the netgear (as Robert0380 suggested), use it as the only router or do something similar to my first post. . . I would probably just use it as the router and turn that bit off on the linux box. All your 'puters will be on the same subnet, and if you need to, you can put the linux box on the DMZ (don't ever leave a windows box open to the net).
 
Old 06-17-2003, 10:12 PM   #8
jvannucci
Member
 
Registered: Jan 2003
Location: Connecticut, US
Distribution: Red Hat 9.0
Posts: 98

Rep: Reputation: 15
Actually, to clarify, 255.255.255.0 is not a subnet or a broadcast. It's a subnet mask. Your subnet is fully defined by stating both the network address and the mask:

192.168.0.0/255.255.255.0

This is a network that has 254 possible host IP addresses. 192.168.0.0 is the network address, 192.168.0.255 is the broadcast address, and all in between are the other 254.

Another way you'll see this referenced is with CIDR notation:

192.168.0.0/24

This just means that the first 24 bits are set in the 32 bit subnet mask (the first 3 255s in 255.255.255.0)
 
Old 06-18-2003, 03:50 PM   #9
bruce1271
Member
 
Registered: Apr 2003
Location: Dallas, TX
Posts: 122

Original Poster
Rep: Reputation: 15
I do not want to use this as a router. All i want is a switch.
Using the uplink port does not work at all. I had it working using a normal port, but I went and upgraded the damn firmware in hopes I would be able to turn off the wireless broadcasting sinceI am not using it. all it did was add restrictions on what I could use.

It was complaing about the subnet mask. 255.255.255.0 not being able to use the same for internet and LAN. I have dhcp turned off everywhere.

Noithing else to do but return this junk.
 
Old 06-18-2003, 06:14 PM   #10
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Quote:
Originally posted by jvannucci
Actually, to clarify, 255.255.255.0 is not a subnet or a broadcast. It's a subnet mask. Your subnet is fully defined by stating both the network address and the mask:

192.168.0.0/255.255.255.0

This is a network that has 254 possible host IP addresses. 192.168.0.0 is the network address, 192.168.0.255 is the broadcast address, and all in between are the other 254.

Another way you'll see this referenced is with CIDR notation:

192.168.0.0/24

This just means that the first 24 bits are set in the 32 bit subnet mask (the first 3 255s in 255.255.255.0)
How embarressing! I apologize for the misinformation I provided above. I have no excuse for it either. jvannucci is, of course, correct.
 
Old 06-18-2003, 06:20 PM   #11
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Quote:
Originally posted by bruce1271
I do not want to use this as a router. All i want is a switch.
Using the uplink port does not work at all. I had it working using a normal port, but I went and upgraded the damn firmware in hopes I would be able to turn off the wireless broadcasting sinceI am not using it. all it did was add restrictions on what I could use.

It was complaing about the subnet mask. 255.255.255.0 not being able to use the same for internet and LAN. I have dhcp turned off everywhere.

Noithing else to do but return this junk.
Not allowing the use of the same subnet mask is silly. As jvannucci explained, the subnet mask is almost meaningless without further information.
Regardless, you should be able to set the IP addresses of all of your computers to be on the same subnet, plug them in to the network ports of the switch (with the same local subnet), and it should work as a switch on the LAN. If you have to, you can even set the WAN IP address of the router to pretty much any number (as long as it's not connected to the real world through the uplink or WAN port), and it should be happy providing packets between your local computers. You need to use straight through cat 5 cables between the switch and your computers. . .
 
  


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
Getting gateway address in C/C++ jormel Programming 2 01-13-2005 06:24 AM
GATEWAY address emailssent Linux - Networking 2 09-30-2004 05:30 AM
gateway address amanjsingh Linux - Newbie 3 06-05-2004 05:42 AM
What is Gateway address and what is Network address? abefroman Linux - Networking 1 03-17-2004 08:25 PM
Gateway Address BittaBrotha Linux - Networking 3 10-13-2003 07:56 AM

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

All times are GMT -5. The time now is 10:33 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
Open Source Consulting | Domain Registration