Public IP reachable without gateway!

Hello,
as we all know a subnet cannot reach another subnet without a default gateway.
so can someone please explain the following scenario:

-The customer has a range of public ips /29
-A DSL modem is bridged ( no configuration on it)
-Routerboard is connected to DSL on ether1, doing pppoe and getting a dynamic ip address 78.x.x.x (dynamic dns and default route are added)
-ether2 is LAN 192.168.1.0/24
-ether3 is public ip address 213.x.x.x/29

customer can ping 213.x.x.x from outside and it is reachable and can log into winbox from anywhere via that ip.

how can public ip 213.x.x.x be reachable on the internet if no default gateway (on its subnet) has been setup in /ip route

Thanks

That subnet is being routed to you via the pppoe connection from your isp

You only need in default gateway per router. You mention that PPPoE is giving you a default gateway.

ok but the default gateway 78.x.x.x is not on the same subnet as the public ip 213.x.x.x
as far as i know 213.x.x.x has to have a default gateway on its same subnet 213.x.x.x/29 to be reachable from the internet.

yea but that default gateway is dynamic from pppoe and it is not on the same subnet as 213.x.x.x/29

The default gateway only needs to be in the same subnet as one network on the device. There isn’t a default gateway per network. Even then its for destination not source.

Packets coming from the Internet are sent to your device by your ISP’s routing table. Packets from your network are sent to your ISP by the default route or more specific routes in your routing table.

What is the IP address assigned to your eth1 or your PPPoE interface are they in the same subnet as the gateway? Without seeing a list of IP addresses on interfaces and a print out of the routing table its hard to know exactly what is going on.

Jonathan

Thanks Jonathan,
the pppoe interface is getting a dynamic ip address from the isp and the gateway is also dynamic(add default route=yes); both of them are 78.x.x.x but the IP block i am getting from the isp is 213.x.x.x/29 i already assigned an ip of this block to ether3.
my question is: how can this IP that i assigned be reachable from the internet? doesn’t it need a gateway on the same subnet 213.x.x.x/29 to be configured in /ip route.
what IF i put this IP on a laptop with windows but without a default gateway can it still be reachable from the internet?

There is only one default gateway per device. Remember the routing table is just that a large table of destination networks and their next hop routers. If there is a specific route for a network then that next hop router is used. If there isn’t one then the default route is used. So in the case of your router it already has a default route (pointing upstream towards your ISP) provided by your ISP. The ISP has a route in their routers for your two networks - the PPPoE net and the /29. If a packet destined to your /29 comes in from the ISP your router will look in its routing table and see a connected route for Ether3 and send it out that interface. If a packet comes in from a machine connected to ether3 with a destination IP not explicitly covered by the routing table it will use the default route and send it on to your ISP.

In the case of a PC connected to Ether3 it determines where to send a packet based on its routing table. Typically if a machine has one NIC it will contain one connected route and a default route (configured in the TCP/IP settings or via DHCP). The default route does need to be on the same network as one of the PC network interfaces.

Example: If you assign 213.x.x.1/29 to ether3 and 213.x.x.2/29 to the computer connected to ether3 you would set the default gateway on the computer to 213.x.x.1/29. The router on the other hand would have a default route pointing towards your ISP which in this case is 78.x.x.y. If the PC did not have a default route packets from your router would get to the PC but it would not know where to send the return packet.

The example above assumes Proxy-ARP is not turned on for ether3. If proxy arp is turned on then any machine that ARPs for what would be a unknown IP usually the router will reply if it knows a route to said IP. Because the router has a default route it will respond for any ARP request with its own IP address if no one responds.