Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: vpnc: devel

Configure MTU on tunel device based on default device

 

 

vpnc devel RSS feed   Index | Next | Previous | View Threaded


tmraz at redhat

Apr 3, 2008, 1:27 AM

Post #1 of 2 (240 views)
Permalink
Configure MTU on tunel device based on default device

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.
--
Tomas Mraz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb
Attachments: vpnc-0.5.1-mtu.patch (0.81 KB)


jmvpnc at loplof

Jun 10, 2008, 6:22 PM

Post #2 of 2 (46 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/

vpnc devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.