create_ap

create a nat-ed wifi ap
git clone git://git.2f30.org/create_ap
Log | Files | Refs | README | LICENSE

commit 348b6e728a3d01cfc3c5698c4f68565cfa3ac2bb
parent 38ebab212234f47b9569721d2d2a058c9d4ca525
Author: oblique <psyberbits@gmail.com>
Date:   Sun, 20 Sep 2015 12:17:48 +0300

Send MTU via DHCP

Fix #108

Diffstat:
Mcreate_ap | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/create_ap b/create_ap @@ -354,6 +354,11 @@ get_macaddr() { cat "/sys/class/net/${1}/address" } +get_mtu() { + is_interface "$1" || return + cat "/sys/class/net/${1}/mtu" +} + alloc_new_iface() { local prefix=$1 local i=0 @@ -1529,6 +1534,8 @@ ${DNSMASQ_BIND} dhcp-range=${GATEWAY%.*}.1,${GATEWAY%.*}.254,255.255.255.0,24h dhcp-option=option:router,${GATEWAY} EOF + MTU=$(get_mtu $INTERNET_IFACE) + [[ -n "$MTU" ]] && echo "dhcp-option=option:mtu,${MTU}" >> $CONFDIR/dnsmasq.conf [[ $ETC_HOSTS -eq 0 ]] && echo no-hosts >> $CONFDIR/dnsmasq.conf fi