
jmvpnc at loplof
Jun 10, 2008, 6:22 PM
Post #2 of 2
(105 views)
Permalink
|
|
Re: Configure MTU on tunel device based on default device
[In reply to]
|
|
Hello Tomas, On Thu, Apr 03, 2008 at 10:27:23AM +0200, Tomas Mraz wrote: > This patch modifies vpnc-script so it doesn't hardcode the MTU on tun > device but computes it based on the MTU of the default route device > instead. It will do this only when ip command is available otherwise > stays with the hardcoded value. ... > - ifconfig "$TUNDEV" inet "$INTERNAL_IP4_ADDRESS" $ifconfig_syntax_ptp "$INTERNAL_IP4_ADDRESS" netmask 255.255.255.255 mtu 1412 up > + if [ -n "$IPROUTE" ]; then > + DEV=$($IPROUTE route | grep ^default | sed 's/^.* dev \([[:alnum:]-]\+\).*$/\1/') > + MTU=$(($($IPROUTE link "$DEV" | grep mtu | sed 's/^.* mtu \([[:digit:]]\+\).*$/\1/') - 88)) Hmm, I needed to change that into "ip link show "$DEV". Did you just miss the show or has the syntax changed? Also: I'm no specialist as far as shells are concerned, but it seems that these lines contain some bash'isms that will fail with ordinary /bin/sh. What do you think? Thanks! Joerg -- Joerg Mayer <jmayer[at]loplof.de> We are stuck with technology when what we really want is just stuff that works. Some say that should read Microsoft instead of technology. _______________________________________________ vpnc-devel mailing list vpnc-devel[at]unix-ag.uni-kl.de https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel http://www.unix-ag.uni-kl.de/~massar/vpnc/
|