mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
This commit is contained in:
31
config/dhcpc/dhcpcd-hooks/10-mtu
Normal file
31
config/dhcpc/dhcpcd-hooks/10-mtu
Normal file
@@ -0,0 +1,31 @@
|
||||
# Configure the MTU for the interface
|
||||
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
||||
|
||||
set_mtu()
|
||||
{
|
||||
local mtu=$1
|
||||
ip link set "$interface" mtu "$mtu"
|
||||
|
||||
# test for buggy nic that lose link at mtu set...
|
||||
carrier=`cat /sys/class/net/$interface/carrier`
|
||||
if [ "$carrier" == "0" ]; then
|
||||
syslog info "Warning! Carrier loss after MTU set. Reinit ..."
|
||||
ip link set "$interface" down
|
||||
ip link set "$interface" up
|
||||
fi
|
||||
}
|
||||
if [ -n "$new_interface_mtu" ] && $if_up; then
|
||||
if [ $RED_DHCP_FORCE_MTU -ge 576 ]; then
|
||||
new_interface_mtu=$RED_DHCP_FORCE_MTU
|
||||
fi
|
||||
if [ ! "$new_interface_mtu" == "$ifmtu" ]; then
|
||||
# The smalled MTU dhcpcd can work with is 576
|
||||
if [ "$new_interface_mtu" -gt 576 ]; then
|
||||
if set_mtu "$new_interface_mtu"; then
|
||||
syslog info "MTU set to $new_interface_mtu"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
etc/system-release
|
||||
etc/issue
|
||||
etc/rc.d/init.d/firewall
|
||||
etc/rc.d/init.d/networking/dhcpcd.exe
|
||||
etc/modprobe.d/nf_conntrack.conf
|
||||
srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat
|
||||
srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat
|
||||
@@ -16,3 +17,4 @@ srv/web/ipfire/cgi-bin/webaccess.cgi
|
||||
usr/bin/pgrep
|
||||
usr/local/bin/qosctrl
|
||||
usr/local/bin/timectrl
|
||||
var/ipfire/dhcpc/dhcpcd-hooks/10-mtu
|
||||
|
||||
Reference in New Issue
Block a user