خرید بک لینک

What is 0.0.0.0 means in destination and gateway column

The "destination" column, together with the "genmask", is a mask that the destination address must match: (packet_destination & route_mask) == route_destination. So a route with destination 0.0.0.0 & mask 0.0.0.0 matches everything – it is the default route.

In the "gateway" column, 0.0.0.0 is merely a placeholder showing that there's no gateway at all, and all matching hosts are reachable directly. So the second route is a local one.

The routing table can become slightly clearer when written in the ip route format:

$ ip -n route show
0.0.0.0/0 via 192.168.2.10 dev eth0
192.168.2.0/24 dev eth0

If the packet is sent from 192.168.2.36 ip, what is the gateway for that. It use 192.168.2.10 or 0.0.0.0

Your routing table doesn't describe the source, only destination, so the question caot be answered based purely on that.

If the packet were sent to 192.168.2.36, then it would match the 192.168.2.0/24 route and wouldn't use any gateway.

And if you actually meant incoming packets, then your routing table doesn't apply to those at all – only the sender's routing table determines the gateway, not the receiver's.

Lets consider I have one more network with ip 192.168.1.0. If the packet is sent from any of the host from this network, what is the gateway for that ip.

If you're receiving the packets, then your routing table is irrelevant. So the question can be answered only based on the sender's routing table.

If you're sending packets to 192.168.1.x, they only match the 0.0.0.0/0 route, so they would use 192.168.2.10 as the gateway.

What is default gateway.

The "default gateway" is the gateway that the default route has.

The "default route" is 0.0.0.0/0 (destination 0.0.0.0 mask 0.0.0.0).

So your "default gateway" is 192.168.2.10.

برچسب: نویسنده: استخدام کار تاريخ: شنبه 21 فروردين 1395 ساعت: 19:05

صفحه بندی