# Push static route to android client

**URL:** <https://discourse.pi-hole.net/t/push-static-route-to-android-client/47055>\
**Category:** Community Help\
**Created:** [May 15, 2021, 12:25pm UTC](https://discourse.pi-hole.net/t/push-static-route-to-android-client/47055 "2021-05-15T12:25:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian-0s](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/christian-0s/32/14597_2.png) [@christian-0s](https://discourse.pi-hole.net/u/christian-0s)\
**Post date:** [May 15, 2021, 12:25pm UTC](https://discourse.pi-hole.net/t/push-static-route-to-android-client/47055/1 "2021-05-15T12:25:24Z")

</div>

Hi  
I added a static route to pihole dhcp server like explained here: [Pihole DHCP: push a static route to clients - #2 by deHakkelaar](https://discourse.pi-hole.net/t/pihole-dhcp-push-a-static-route-to-clients/20617/2)

```auto
cat /etc/dnsmasq.d/99-my-settings.conf
dhcp-option=option:classless-static-route,0.0.0.0/0,192.168.0.2,192.168.1.0/24,192.168.0.11

```

It's working great on my pc running linux:

```auto
ip route
default via 192.168.0.2 dev wlan0 proto dhcp metric 600 
169.254.0.0/16 dev wlan0 scope link metric 1000 
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.235 metric 600 
192.168.1.0/24 via 192.168.0.11 dev wlan0 proto dhcp metric 600

```

however my android tablet does not get it. It's running android Oreo, not rooted.  
Any idea on how to solve this issue?

Many thanks  
Christian

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [May 15, 2021, 8:23pm UTC](https://discourse.pi-hole.net/t/push-static-route-to-android-client/47055/2 "2021-05-15T20:23:32Z")

</div>

I added below route for testing:

```auto
pi@ph5a:~ $ sudo nano /etc/dnsmasq.d/99-my-settings.conf
dhcp-option=option:classless-static-route,0.0.0.0/0,10.0.0.1,192.168.1.0/24,10.0.0.99

```

And after renewing client DHCP leases, my Windows and Linux clients have the added route configured:

```auto
C:\>route PRINT
[..]
      192.168.1.0 255.255.255.0 10.0.0.99 10.0.0.11 11
[..]

```

```auto
dehakkelaar@laptop:~$ ip route show
[..]
192.168.1.0/24 via 10.0.0.99 dev wlan0 proto dhcp metric 600

```

But my Android phone doesnt in a [Termux](https://termux.com/) session:

```auto
$ ip route show
10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.143
10.83.242.0/24 dev rmnet1 proto kernel scope link src 10.83.242.254

```

But I dont trust Termux because I believe it runs in an environment different from what the apps are running in.  
For example the `nslookup` tool always queries `8.8.8.8` default and not the DNS servers received via DHCP:

```auto
$ nslookup pi-hole.net
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: pi-hole.net
Address: 178.128.134.214

```

So I dont know of a reliable way to show the routes under Android other than actually testing/using the route.

---

<div class="post-metadata">

**Author:** ![christian-0s](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/christian-0s/32/14597_2.png) [@christian-0s](https://discourse.pi-hole.net/u/christian-0s)\
**Post date:** [May 16, 2021, 10:36am UTC](https://discourse.pi-hole.net/t/push-static-route-to-android-client/47055/3 "2021-05-16T10:36:25Z")

</div>

Looking around, it seems Android has issues with static routes, so I gave up on this approach and instead set a routing rule on the system running pi-hole, which also acts as a gateway. I don't know why I didn't think of that before...

```auto
iface eth0 inet static
	address 192.168.0.2
	netmask 255.255.255.0
	network 192.168.0.0
	broadcast 192.168.0.255
	up ip route add default via 192.168.0.1 dev eth0 metric 200
	up ip route add default via 192.168.42.129 dev usb0 metric 100
	up ip route add 192.168.1.0/24 via 192.168.0.11 dev eth0

```

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [June 6, 2021, 10:36am UTC](https://discourse.pi-hole.net/t/push-static-route-to-android-client/47055/4 "2021-06-06T10:36:29Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
