<s>
A	O
default	B-Protocol
gateway	I-Protocol
is	O
the	O
node	B-Protocol
in	O
a	O
computer	B-Architecture
network	I-Architecture
using	O
the	O
Internet	B-Protocol
protocol	I-Protocol
suite	I-Protocol
that	O
serves	O
as	O
the	O
forwarding	O
host	O
(	O
router	B-Protocol
)	O
to	O
other	O
networks	O
when	O
no	O
other	O
route	B-Protocol
specification	O
matches	O
the	O
destination	O
IP	B-Protocol
address	I-Protocol
of	O
a	O
packet	O
.	O
</s>
<s>
A	O
gateway	O
is	O
a	O
network	B-Protocol
node	I-Protocol
that	O
serves	O
as	O
an	O
access	O
point	O
to	O
another	O
network	O
,	O
often	O
involving	O
not	O
only	O
a	O
change	O
of	O
addressing	O
,	O
but	O
also	O
a	O
different	O
networking	O
technology	O
.	O
</s>
<s>
More	O
narrowly	O
defined	O
,	O
a	O
router	B-Protocol
merely	O
forwards	O
packets	O
between	O
networks	O
with	O
different	O
network	O
prefixes	O
.	O
</s>
<s>
The	O
networking	B-Architecture
software	I-Architecture
stack	O
of	O
each	O
computer	O
contains	O
a	O
routing	B-Protocol
table	I-Protocol
that	O
specifies	O
which	O
interface	O
is	O
used	O
for	O
transmission	O
and	O
which	O
router	B-Protocol
on	O
the	O
network	O
is	O
responsible	O
for	O
forwarding	O
to	O
a	O
specific	O
set	O
of	O
addresses	O
.	O
</s>
<s>
If	O
none	O
of	O
these	O
forwarding	O
rules	O
is	O
appropriate	O
for	O
a	O
given	O
destination	O
address	O
,	O
the	O
default	B-Protocol
gateway	I-Protocol
is	O
chosen	O
as	O
the	O
router	B-Protocol
of	O
last	O
resort	O
.	O
</s>
<s>
The	O
default	B-Protocol
gateway	I-Protocol
can	O
be	O
specified	O
by	O
the	O
route	B-Protocol
command	O
to	O
configure	O
the	O
node	B-Protocol
's	O
routing	B-Protocol
table	I-Protocol
and	O
default	B-Protocol
route	I-Protocol
.	O
</s>
<s>
In	O
a	O
home	O
or	O
small	O
office	O
environment	O
,	O
the	O
default	B-Protocol
gateway	I-Protocol
is	O
a	O
device	O
,	O
such	O
as	O
a	O
DSL	B-Device
router	I-Device
or	O
cable	B-Device
router	I-Device
,	O
that	O
connects	O
the	O
local	O
network	O
to	O
the	O
Internet	O
.	O
</s>
<s>
It	O
serves	O
as	O
the	O
default	B-Protocol
gateway	I-Protocol
for	O
all	O
network	O
devices	O
.	O
</s>
<s>
Enterprise	O
network	O
systems	O
may	O
require	O
many	O
internal	O
network	B-Protocol
segments	I-Protocol
.	O
</s>
<s>
A	O
device	O
wishing	O
to	O
communicate	O
with	O
a	O
host	O
on	O
the	O
public	O
Internet	O
,	O
for	O
example	O
,	O
forwards	O
the	O
packet	O
to	O
the	O
default	B-Protocol
gateway	I-Protocol
for	O
its	O
network	B-Protocol
segment	I-Protocol
.	O
</s>
<s>
This	O
router	B-Protocol
also	O
has	O
a	O
default	B-Protocol
route	I-Protocol
configured	O
to	O
a	O
device	O
on	O
an	O
adjacent	O
network	O
,	O
one	O
hop	O
closer	O
to	O
the	O
public	O
network	O
.	O
</s>
<s>
The	O
following	O
example	O
shows	O
IP	B-Protocol
addresses	I-Protocol
that	O
might	O
be	O
used	O
with	O
an	O
office	O
network	O
that	O
consists	O
of	O
six	O
hosts	O
plus	O
a	O
router	B-Protocol
.	O
</s>
<s>
The	O
router	B-Protocol
's	O
inside	O
address	O
is	O
:	O
</s>
<s>
The	O
network	O
has	O
a	O
subnet	B-Protocol
mask	I-Protocol
of	O
:	O
</s>
<s>
TCP/IP	B-Protocol
defines	O
the	O
addresses	O
192.168.4.0	O
(	O
network	O
ID	O
address	O
)	O
and	O
192.168.4.255	O
(	O
broadcast	O
IP	B-Protocol
address	I-Protocol
)	O
.	O
</s>
<s>
The	O
office	O
's	O
hosts	O
send	O
packets	O
to	O
addresses	O
within	O
this	O
range	O
directly	O
,	O
by	O
resolving	O
the	O
destination	O
IP	B-Protocol
address	I-Protocol
into	O
a	O
MAC	O
address	O
with	O
the	O
Address	O
Resolution	O
Protocol	O
(	O
ARP	O
)	O
sequence	O
and	O
then	O
encapsulates	O
the	O
IP	B-Protocol
packet	O
into	O
a	O
MAC	O
frame	O
addressed	O
to	O
the	O
destination	O
host	O
.	O
</s>
<s>
Instead	O
it	O
must	O
be	O
sent	O
to	O
the	O
default	B-Protocol
gateway	I-Protocol
for	O
further	O
routing	O
to	O
their	O
ultimate	O
destination	O
.	O
</s>
<s>
In	O
this	O
example	O
,	O
the	O
default	B-Protocol
gateway	I-Protocol
uses	O
the	O
IP	B-Protocol
address	I-Protocol
192.168.4.1	O
,	O
which	O
is	O
resolved	O
into	O
a	O
MAC	O
address	O
with	O
ARP	O
in	O
the	O
usual	O
way	O
.	O
</s>
<s>
The	O
destination	O
IP	B-Protocol
address	I-Protocol
remains	O
192.168.12.3	O
,	O
but	O
the	O
next-hop	O
MAC	O
address	O
is	O
that	O
of	O
the	O
gateway	O
,	O
rather	O
than	O
of	O
the	O
ultimate	O
destination	O
.	O
</s>
<s>
In	O
another	O
example	O
,	O
a	O
network	O
with	O
three	O
routers	B-Protocol
and	O
three	O
hosts	O
is	O
connected	O
to	O
the	O
Internet	O
through	O
Router1	O
.	O
</s>
<s>
Network	O
mask	O
in	O
all	O
networks	O
:	O
255.255.255.0	O
(	O
/24	B-Protocol
in	O
CIDR	B-Protocol
notation	O
)	O
.	O
</s>
<s>
If	O
the	O
routers	B-Protocol
do	O
not	O
use	O
a	O
routing	B-Protocol
protocol	I-Protocol
to	O
discover	O
which	O
network	O
each	O
router	B-Protocol
is	O
connected	O
to	O
,	O
then	O
the	O
routing	B-Protocol
table	I-Protocol
of	O
each	O
router	B-Protocol
must	O
be	O
set	O
up	O
.	O
</s>
<s>
Router2	O
manages	O
its	O
attached	O
networks	O
and	O
default	B-Protocol
gateway	I-Protocol
;	O
router	B-Protocol
3	O
does	O
the	O
same	O
;	O
router	B-Protocol
1	O
manages	O
all	O
routes	O
within	O
the	O
internal	O
networks	O
.	O
</s>
<s>
If	O
PC2	O
(	O
172.16.1.100	O
)	O
needs	O
to	O
access	O
PC3	O
(	O
192.168.1.100	O
)	O
,	O
since	O
PC2	O
has	O
no	O
route	B-Protocol
to	O
192.168.1.100	O
it	O
will	O
send	O
packets	O
for	O
PC3	O
to	O
its	O
default	B-Protocol
gateway	I-Protocol
(	O
router2	O
)	O
.	O
</s>
<s>
Router2	O
also	O
has	O
no	O
route	B-Protocol
to	O
PC3	O
,	O
and	O
it	O
will	O
forward	O
the	O
packets	O
to	O
its	O
default	B-Protocol
gateway	I-Protocol
(	O
router1	O
)	O
.	O
</s>
<s>
Router1	O
has	O
a	O
route	B-Protocol
for	O
this	O
network	O
(	O
192.168.1.0/24	O
)	O
so	O
router1	O
will	O
forward	O
the	O
packets	O
to	O
router3	O
,	O
which	O
will	O
deliver	O
the	O
packets	O
to	O
PC3	O
;	O
reply	O
packets	O
will	O
follow	O
the	O
reverse	O
path	O
back	O
to	O
PC2	O
.	O
</s>
<s>
If	O
any	O
of	O
the	O
computers	O
try	O
to	O
access	O
a	O
webpage	O
on	O
the	O
Internet	O
,	O
like	O
https://en.wikipedia.org/	O
,	O
the	O
destination	O
will	O
first	O
be	O
resolved	O
to	O
an	O
IP	B-Protocol
address	I-Protocol
by	O
using	O
DNS-resolving	O
.	O
</s>
<s>
The	O
IP-address	B-Protocol
could	O
be	O
91.198.174.2	O
.	O
</s>
<s>
In	O
this	O
example	O
,	O
none	O
of	O
the	O
internal	O
routers	B-Protocol
know	O
the	O
route	B-Protocol
to	O
that	O
host	O
,	O
so	O
they	O
will	O
forward	O
the	O
packet	O
through	O
router1	O
's	O
gateway	O
or	O
default	B-Protocol
route	I-Protocol
.	O
</s>
<s>
Every	O
router	B-Protocol
on	O
the	O
packet	O
's	O
way	O
to	O
the	O
destination	O
will	O
check	O
whether	O
the	O
packet	O
's	O
destination	O
IP-address	B-Protocol
matches	O
any	O
known	O
network	O
routes	O
.	O
</s>
<s>
If	O
a	O
router	B-Protocol
finds	O
a	O
match	O
,	O
it	O
will	O
forward	O
the	O
packet	O
through	O
that	O
route	B-Protocol
;	O
if	O
not	O
,	O
it	O
will	O
send	O
the	O
packet	O
to	O
its	O
own	O
default	B-Protocol
gateway	I-Protocol
.	O
</s>
<s>
Each	O
router	B-Protocol
encountered	O
on	O
the	O
way	O
will	O
store	O
the	O
packet	O
ID	O
and	O
where	O
it	O
came	O
from	O
so	O
that	O
it	O
can	O
pass	O
the	O
response	O
packet	O
back	O
to	O
the	O
sender	O
.	O
</s>
<s>
The	O
packet	O
contains	O
source	O
and	O
destination	O
,	O
not	O
all	O
router	B-Protocol
hops	O
.	O
</s>
<s>
At	O
last	O
the	O
packet	O
will	O
arrive	O
back	O
to	O
router1	O
,	O
which	O
will	O
check	O
for	O
matching	O
packet	O
ID	O
and	O
route	B-Protocol
it	O
accordingly	O
through	O
router2	O
or	O
router3	O
or	O
directly	O
to	O
PC1	O
(	O
which	O
was	O
connected	O
in	O
the	O
same	O
network	B-Protocol
segment	I-Protocol
as	O
router1	O
)	O
.	O
</s>
<s>
If	O
router1	O
routing	B-Protocol
table	I-Protocol
does	O
not	O
have	O
any	O
route	B-Protocol
to	O
192.168.1.0/24	O
,	O
and	O
PC3	O
tries	O
to	O
access	O
a	O
resource	O
outside	O
its	O
own	O
network	O
,	O
then	O
the	O
outgoing	O
routing	O
will	O
work	O
until	O
the	O
reply	O
is	O
fed	O
back	O
to	O
router1	O
.	O
</s>
<s>
Since	O
the	O
route	B-Protocol
is	O
unknown	O
to	O
router1	O
,	O
it	O
will	O
go	O
to	O
router1	O
's	O
default	B-Protocol
gateway	I-Protocol
,	O
and	O
never	O
reach	O
router3	O
.	O
</s>
<s>
The	O
packet	O
will	O
die	O
because	O
the	O
TTL-value	O
decreased	O
to	O
less	O
than	O
1	O
when	O
it	O
was	O
traveling	O
through	O
the	O
routers	B-Protocol
,	O
or	O
the	O
router	B-Protocol
will	O
see	O
that	O
it	O
has	O
a	O
private	O
IP	B-Protocol
and	O
discard	O
it	O
.	O
</s>
<s>
This	O
could	O
be	O
discovered	O
by	O
using	O
the	O
Microsoft	B-Application
Windows	I-Application
utility	O
PathPing	B-Protocol
or	O
MTR	B-Protocol
on	O
Unix-like	O
operating	O
systems	O
,	O
since	O
the	O
ping	O
will	O
stop	O
at	O
the	O
router	B-Protocol
which	O
has	O
no	O
route	B-Protocol
or	O
a	O
wrong	O
route	B-Protocol
.	O
</s>
<s>
(	O
Note	O
that	O
some	O
routers	B-Protocol
will	O
not	O
reply	O
to	O
pinging	O
)	O
.	O
</s>
<s>
Various	O
utility	B-Application
software	I-Application
can	O
show	O
the	O
default	B-Protocol
gateway	I-Protocol
.	O
</s>
<s>
On	O
Windows	O
,	O
ipconfig	O
may	O
be	O
used	O
,	O
while	O
on	O
Unix	B-Application
systems	I-Application
,	O
ifconfig	B-Protocol
or	O
netstat	B-Application
may	O
be	O
used	O
.	O
</s>
<s>
On	O
Linux	O
netstat	B-Application
has	O
been	O
superseded	O
by	O
iproute2	B-Protocol
.	O
</s>
