D
D
Dganic2017-01-26 12:35:24
linux
Dganic, 2017-01-26 12:35:24

Disable default route output in dnsmasq?

There is a dhcp-server dnsmasq (Dnsmasq version 2.75) it is required to issue addresses, and one specific route to a specific subnet. Workstations on Windows 7 act as clients. The problem is that along with the route, a default route arrives with a metric lower than that already present on the PC and, accordingly, traffic goes along the wrong route. dhcp-option=3 is not set in the configuration file, where it comes from, I can't understand.
dnsmasq config file:

listen-address=10.200.1.1
dhcp-range=edu,10.200.1.10,10.200.1.254,255.255.255.0,12h
dhcp-option=edu,6,10.0.5.1,10.0.5.2
dhcp-option=edu,121,10.0.5.0/24,10.200.1.1
dhcp-option=edu,249,10.0.5.0/24,10.200.1.1


listen-address=10.200.2.1
dhcp-range=gkh,10.200.2.10,10.200.2.254,255.255.255.0,12h
dhcp-option=gkh,6,10.0.5.1,10.0.5.2
dhcp-option=gkh,121,10.0.5.0/24,10.200.2.1
dhcp-option=gkh,249,10.0.5.0/24,10.200.2.1
dhcp-leasefile=/tmp/dhcp.leases

Connection screenshot:
c1041ec903b04f229b751ab7899b21dd.png
I'll try to explain again:
I have a LAN connection configured with a default gateway and an appropriate default route to that gateway. There is another TAP-Windows-adapter network adapter (which I am talking about) that works with a VPN client (not built into Windows) after raising the tunnel, the IP address of the dns server arrives on this network adapter using DHCP from dnsmasq and my route to a specific subnet, through a specific gateway (which is indicated in the config), but somehow the main gateway also arrives at this adapter, although I don’t ask it about it, a separate parameter is responsible for issuing the main gateway in dnsmasq: dhcp-option=3,192.168.0.1 (I don’t have this option in the configuration), and in a place with another default gateway, a new default route arrives with a metric less than the old one, and accordingly all traffic is wrapped on the new gateway. And I have one simple question, how to make dnsmasq not propagate the default gateway.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dganic, 2017-01-27
@Dganic

Everything turned out to be simple, you need to specify option 3 without specifying the gateway, for example:
And we get an empty default gateway:
3e4ea427bd424e56a49a64a9a6cdd958.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question