Tag Archives: debian

Test Jumbo Frames / MTU 9000

Linux:

ping -M do -s 8972 xxx.xxx.xxx.xxx

OSX/BSD:

ping -D -s 8184 xxx.xxx.xxx.xxx

Windows:

ping -f -l 9000 xxx.xxx.xxx.xxx

Example results on Linux

If you’ve forgotten to enable jumbo frames/9k MTU on your client device you’re sending the ping from:

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
ping: sendto: Message too long

If you have enabled jumbo frames on your client but not the destination (or a switch in between):

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
Request timeout for icmp_seq 0

If you’ve done everything righ:

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
8192 bytes from xxx.xxx.xxx.xxx: icmp_seq=0 ttl=128 time=0.714 ms

Static network config with dhcp fallback

/etc/network/interfaces:

auto wan
iface wan inet manual
	up ifup eth0=eth0-static
	post-up /etc/network/checkConnectivity.sh eth0 192.168.0.1 10.10.0.2

iface eth0 inet manual

#static eth0 config
iface eth0-static inet static
	address 192.168.0.97
	netmask 255.255.255.0
	gateway 192.168.0.1
	dns-nameservers 192.168.0.1 10.10.0.2
	dns-search example.net

#dhcp eth0 config
iface eth0-dhcp inet dhcp

/etc/network/checkConnectivity.sh:

#!/bin/bash
nif=${1}
shift


sleep 1

for i in ${@}; do
	ping -c 2 ${i} \
		&& exit 0
done

# if nothing responds
ifdown ${nif}
ifup ${nif}=${nif}-dhcp

manually override:

  • ifup eth0=eth0-static
  • ifup eth0=eth0-dhcp

WebDAV with cURL

Assuming the following Data:

  • Webdav URL: http://example.com/webdav
  • Username: user
  • Password: pass

Actions

Reading Files/Folders

curl 'http://example.com/webdav'

Creating new Folder

curl -X MKCOL 'http://example.com/webdav/new_folder'

Uploading File

curl -T '/path/to/local/file.txt' 'http://example.com/webdav/test/new_name.txt'

Renaming File

curl -X MOVE --header 'Destination:http://example.org/webdav/new.txt' 'http://example.com/webdav/old.txt'

Deleting Files/Folders

File:

curl -X DELETE 'http://example.com/webdav/test.txt'

Folder:

curl -X DELETE 'http://example.com/webdav/test'

List Files in a Folder

curl -i -X PROPFIND http://example.com/webdav/ --upload-file - -H "Depth: 1" <<end
<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop><a:resourcetype/></a:prop>
</a:propfind>
end

Continue reading WebDAV with cURL