Test your jumbo frame enabled network with ping

ping -Mdo -s

If it works:
$ ping -Mdo -s 8001 10.0.20.26
PING 10.0.20.26 (10.0.20.26) 8001(8029) bytes of data.
8009 bytes from 10.0.20.26: icmp_req=1 ttl=64 time=0.450 ms
8009 bytes from 10.0.20.26: icmp_req=2 ttl=64 time=0.468 ms (DUP!)
8009 bytes from 10.0.20.26: icmp_req=3 ttl=64 time=0.447 ms

If it doesnt:
$ ping -Mdo -s 2001 195.10.34.51 -c3
PING 195.10.34.51 (195.10.34.51) 2001(2029) bytes of data.
From XX.XX.XX.XX icmp_seq=1 Frag needed and DF set (mtu = 1500)
From XX.XX.XX.XX icmp_seq=1 Frag needed and DF set (mtu = 1500)
From XX.XX.XX.XX icmp_seq=1 Frag needed and DF set (mtu = 1500)

Tags: , , , , , ,

I just installed a new debian etch box with dhcp, changed the /etc/network/interfaces to a static setup and now /etc/init.d/network restart does not work….

gah… We use FAI to auto install our debian servers. It installs the system with dhcp and when it reboots for the first time the box comes perfectly online. However, I want the box to have a static address and so far this is a manual operations in our setup. So i change my /etc/network/interfaces file to reflect a static setup, something like:

host:~# cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.250
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

I just copy/pasted this setup from another box on the same network and changed the “address” field. And then i issued:

host:~# /etc/init.d/networking restart
Reconfiguring network interfaces...done.

Hmmm nothing happens… Lets take a peak in the init.d script and see what the hell it does:

host:~# cat /etc/init.d/networking
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking
# Required-Start: mountkernfs ifupdown $local_fs
# Required-Stop: ifupdown $local_fs
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
### END INIT INFO

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"

[ -x /sbin/ifup ] || exit 0

. /lib/lsb/init-functions

spoofprotect_rp_filter() {
[ -e /proc/sys/net/ipv4/conf/all/rp_filter ] || return 1
RC=0
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo 1 > $f || RC=1
done
return $RC
}

spoofprotect() {
log_action_begin_msg "Setting up IP spoofing protection"
if spoofprotect_rp_filter; then
log_action_end_msg 0 "rp_filter"
else
log_action_end_msg 1
fi
}

ip_forward() {
log_action_begin_msg "Enabling packet forwarding"
if echo 1 > /proc/sys/net/ipv4/ip_forward; then
log_action_end_msg 0
else
log_action_end_msg 1
fi
}

syncookies() {
log_action_begin_msg "Enabling TCP SYN cookies"
if echo 1 > /proc/sys/net/ipv4/tcp_syncookies; then
log_action_end_msg 0
else
log_action_end_msg 1
fi
}

doopt() {
optname=$1
default=$2
opt=`grep "^$optname=" /etc/network/options || true`
if [ -z "$opt" ]; then
opt="$optname=$default"
fi
optval=${opt#$optname=}
if [ "$optval" = "yes" ]; then
eval $optname
fi
}

process_options() {
[ -e /etc/network/options ] || return 0
log_warning_msg "/etc/network/options is deprecated (see README.Debian of netbase)."
doopt spoofprotect yes
doopt syncookies no
doopt ip_forward no
}

case "$1" in
start)
process_options
log_action_begin_msg "Configuring network interfaces"
if ifup -a; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;

stop)
if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
grep -qE '^(nfs[1234]?|smbfs|ncp|ncpfs|coda|cifs)$'; then
log_warning_msg "not deconfiguring network interfaces: network shares still mounted."
exit 0
fi

log_action_begin_msg "Deconfiguring network interfaces"
if ifdown -a --exclude=lo; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;

force-reload|restart)
process_options
log_action_begin_msg "Reconfiguring network interfaces"
ifdown -a --exclude=lo || true
if ifup -a --exclude=lo; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;

*)
echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
exit 1
;;
esac

exit 0

The interesting part is the restart|reload function:

log_action_begin_msg "Reconfiguring network interfaces"
ifdown -a --exclude=lo || true
if ifup -a --exclude=lo; then

Oki so lets try to issue these commands manually and see what happens:

host:~# ifdown eth0
ifdown: interface eth0 not configured

…. *sigh*. Now what, I just configured it… Its time to look at some other boxes where this doesnt happen. And I find that some boxes does not have the “allow-hotplug eth0″, but instead just “auto eth0″. So I changed my setup to the following:

host:~# cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.250
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

And what do you know…. IT WORKED!!

Tags: , , , , ,