how to dnsmasq set mtu
时间: 2024-01-03 19:04:34 浏览: 108
To set the MTU (Maximum Transmission Unit) for dnsmasq, you can add the `dhcp-option-force` parameter to the dnsmasq configuration file. Here are the steps to do it:
1. Open the dnsmasq configuration file. On most Linux distros, the file is located at `/etc/dnsmasq.conf`.
2. Add the following line to the file:
```
dhcp-option-force=option:mtu,<MTU_SIZE>
```
Replace `<MTU_SIZE>` with the desired MTU size, such as 1500, 1400, or any other value that fits your network configuration.
3. Save the file and restart the dnsmasq service for the changes to take effect. On most Linux distros, you can do this with the following command:
```
sudo systemctl restart dnsmasq
```
That's it! Now dnsmasq will advertise the specified MTU size to DHCP clients that request it. Note that not all DHCP clients respect the MTU option, so it may not have an effect on all devices in your network.
阅读全文