Networking

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Networking

Postby i.couchman » Sun Jul 01, 2012 12:36 pm

I hope one of the resident gurus can explain an anomaly I came across recently.
I had to set up a machine on a network which had to connect to a machine on another network ( both connected somehow, I don't know details). The info I was give was as follows:
address 192.168.89.32
netmask 255.255.255.192
network 192.168.89.64
gateway 192.168.89.126

However, when I try to bring up the interface, I get
SIOCADDRT: No such process
presumably because the address is not on the same subnet as the gateway. If I change the address to192.168.89.65 ( on the same subnet) it works fine.

Now, the network in question works. It's used for many applications on the site. So how do they do it? How is routing set up with no default gateway on the same subnet? :?
Ian
i.couchman
LXF regular
 
Posts: 225
Joined: Thu Jul 13, 2006 10:43 am

Postby scarydeath » Sat Aug 11, 2012 8:57 pm

Your gateway needs to be on the same subnet, as it is this gateway your packets of information will travel through to get to a machine on another subnet.

I once had a Zen account with 8 IP addresses. This meant that my subnet was right next door to a subnet belonging to someone else, who may be many Internet hops away. It is impossible for the packet to go to this other subnet if there is no default gateway in your own subnet to tell it where to go.

I hope that makes some sort of sense?
scarydeath
 
Posts: 5
Joined: Sat Aug 11, 2012 8:46 pm

Postby wyliecoyoteuk » Sun Aug 12, 2012 10:39 am

That mask only allows 62 clients (network and broadcast addresses are the first and last nodes of each network) in each of 4 networks:

network
from -- to

192.168.89.0 192.168.89.1--192.168.89.62
192.168.89.64 192.168.89.65-- 192.168.89.126
192.168.89.128 192.168.89.129-- 192.168.89.190
192.168.89.192 192.168.89.193 --192.168.89.254

so the machine at 192.168.89.32 is on the 192.168.89.0 network, and the gateway is on the 192.168.89.64 network, and therefore the 2 are not connected.


http://www.subnetmask.info/
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
User avatar
wyliecoyoteuk
LXF regular
 
Posts: 3460
Joined: Sun Apr 10, 2005 10:41 pm
Location: Birmingham, UK

Postby guy » Sun Aug 12, 2012 10:54 am

To dig a little deeper:

Each of those 123 triplets represents a binary byte - eight 0's and 1's.

The subnet mask is 11111111.11111111.11111111.11000000 - 26 1's followed by 6 0's.

This means that for devices to be on the same network, those first 26 bits of their addresses must all be the same, and the last 6 must be unique to each device.

The addresses you have been given for your machine and the gateway have differing 26th bits.

So; either; one of these needs changing, or the mask can be changed.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: Networking

Postby scarydeath » Sun Aug 12, 2012 5:18 pm

i.couchman wrote:Now, the network in question works. It's used for many applications on the site. So how do they do it? How is routing set up with no default gateway on the same subnet? :?
Ian


But back to the original question, I imagine there is some sort of network bridge between the two subnets.
scarydeath
 
Posts: 5
Joined: Sat Aug 11, 2012 8:46 pm

Postby wyliecoyoteuk » Sun Aug 12, 2012 7:37 pm

the clue is in the statement "default gateway"
"default" is not the same as "only"
There can be many gateways, the default is just the one that is used if there is no other existing route.

Unless there is a route between networks, they cannot communicate.
That does not mean that there is only one route per network.

However, the 192.168.89.126 address is not a gateway for the
192.168.89.0 network (which the 192.168.89.32 host is on), it is a gateway for the 192.168 .89.64 network.

You cannot use a gateway that is not in the same subnet.
And yes there may be a network bridge, but it will be seen as a gateway in the same subnet.

edited to correct badly phrased explanation
Last edited by wyliecoyoteuk on Mon Aug 13, 2012 8:38 pm, edited 1 time in total.
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
User avatar
wyliecoyoteuk
LXF regular
 
Posts: 3460
Joined: Sun Apr 10, 2005 10:41 pm
Location: Birmingham, UK

Postby guy » Mon Aug 13, 2012 7:11 pm

I think the OP's question is answered by the fact that, on any given subnet, you don't need a gateway. You only need one of those when connecting to another (typically bigger) network.

The OP has a small network and is connecting to a bigger Local Area Network (LAN), hence the need for a gateway on this occasion.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby wyliecoyoteuk » Mon Aug 13, 2012 8:29 pm

A gateway still needs to be on the same subnet as the device using it.
He has 2 subnets, the device is on one, and the default gateway on another.

You can have multiple gateways on a subnet, each connecting to another different network. The default gateway is only used for addresses which are not on the same subnet and which don't have a defined route in the routing table.
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
User avatar
wyliecoyoteuk
LXF regular
 
Posts: 3460
Joined: Sun Apr 10, 2005 10:41 pm
Location: Birmingham, UK

Postby Bruno » Tue Aug 14, 2012 2:31 pm

Hi There,

Please understand that networking isn't my strong suit, but is there a good reason why your gateway has an IP address in the private 192.168. range? If your two machines connect over the public internet, this may be where your problem lies.

ATB,
Bruno
User avatar
Bruno
LXF regular
 
Posts: 139
Joined: Tue Sep 18, 2007 6:07 pm
Location: Cambridgeshire, UK

Postby dandnsmith » Wed Aug 15, 2012 6:22 am

The gateway address is one to which you send traffic outside the machine - so can be the address of the port on the machine which connects (for example) to a router. This will, perforce, be a local IP address. unless you have one which is directly connected to the internet and having a non-local IP address.

HTH
Derek
dandnsmith
LXF regular
 
Posts: 314
Joined: Fri Apr 15, 2005 10:01 am
Location: Berks, UK

Postby wyliecoyoteuk » Wed Aug 15, 2012 3:43 pm

Well, I expect that the OP is probably as confused as some of the above posts by now

:roll:

Read example 2:

http://en.wikipedia.org/wiki/Default_gateway
The sig between the asterisks is so cool that only REALLY COOL people can even see it!

*************** ************
User avatar
wyliecoyoteuk
LXF regular
 
Posts: 3460
Joined: Sun Apr 10, 2005 10:41 pm
Location: Birmingham, UK


Return to Help!

Who is online

Users browsing this forum: MartyBartfast and 2 guests