| View previous topic :: View next topic |
| Author |
Message |
i.couchman LXF regular
Joined: Thu Jul 13, 2006 11:43 am Posts: 222
|
Posted: Sun Jul 01, 2012 1:36 pm Post subject: Networking |
|
|
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 |
|
| Back to top |
|
 |
scarydeath
Joined: Sat Aug 11, 2012 9:46 pm Posts: 5
|
Posted: Sat Aug 11, 2012 9:57 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
wyliecoyoteuk LXF regular

Joined: Sun Apr 10, 2005 11:41 pm Posts: 3359 Location: Birmingham, UK
|
Posted: Sun Aug 12, 2012 11:39 am Post subject: |
|
|
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!
*************** ************ |
|
| Back to top |
|
 |
guy LXF regular

Joined: Thu Apr 07, 2005 1:07 pm Posts: 830 Location: Worcestershire
|
Posted: Sun Aug 12, 2012 11:54 am Post subject: |
|
|
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 noob |
|
| Back to top |
|
 |
scarydeath
Joined: Sat Aug 11, 2012 9:46 pm Posts: 5
|
Posted: Sun Aug 12, 2012 6:18 pm Post subject: Re: Networking |
|
|
| 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. |
|
| Back to top |
|
 |
wyliecoyoteuk LXF regular

Joined: Sun Apr 10, 2005 11:41 pm Posts: 3359 Location: Birmingham, UK
|
Posted: Sun Aug 12, 2012 8:37 pm Post subject: |
|
|
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 _________________ The sig between the asterisks is so cool that only REALLY COOL people can even see it!
*************** ************
Last edited by wyliecoyoteuk on Mon Aug 13, 2012 9:38 pm; edited 1 time in total |
|
| Back to top |
|
 |
guy LXF regular

Joined: Thu Apr 07, 2005 1:07 pm Posts: 830 Location: Worcestershire
|
Posted: Mon Aug 13, 2012 8:11 pm Post subject: |
|
|
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 noob |
|
| Back to top |
|
 |
wyliecoyoteuk LXF regular

Joined: Sun Apr 10, 2005 11:41 pm Posts: 3359 Location: Birmingham, UK
|
Posted: Mon Aug 13, 2012 9:29 pm Post subject: |
|
|
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!
*************** ************ |
|
| Back to top |
|
 |
Bruno LXF regular

Joined: Tue Sep 18, 2007 7:07 pm Posts: 139 Location: Cambridgeshire, UK
|
Posted: Tue Aug 14, 2012 3:31 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
dandnsmith LXF regular
Joined: Fri Apr 15, 2005 11:01 am Posts: 267 Location: Berks, UK
|
Posted: Wed Aug 15, 2012 7:22 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
wyliecoyoteuk LXF regular

Joined: Sun Apr 10, 2005 11:41 pm Posts: 3359 Location: Birmingham, UK
|
Posted: Wed Aug 15, 2012 4:43 pm Post subject: |
|
|
Well, I expect that the OP is probably as confused as some of the above posts by now
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!
*************** ************ |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|