LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   vpnc on Slackware 14.2 is bringing up network configuration dialog each time (https://www.linuxquestions.org/questions/slackware-14/vpnc-on-slackware-14-2-is-bringing-up-network-configuration-dialog-each-time-4175595447/)

willbprog127 12-14-2016 09:55 PM

vpnc on Slackware 14.2 is bringing up network configuration dialog each time
 
1 Attachment(s)
Greetings!

Running both the SBo and non-SBo versions of vpnc causes Slackware 14.2 to display the network configuration dialog every time, even though the network has already been set up. (please see attached screenshot of the dialog). Thinking maybe it was a one-time thing, I went through the network setup screens, only for it to appear again after I finished the setup.

After I Ctrl + C out of the setup dialog, then vpnc connects properly. This is a pain because scripting this blocks execution when the network setup dialog comes up (in a hidden shell) every time.

Is there anything I need to check for to prevent the network dialog from coming up when vpnc is run?

Thank you in advance,

Will B

willbprog127 12-15-2016 12:57 PM

Additional information:

I'm using a static IP address on a wired Ethernet connection. Issuing 'ip add' shows the following:

Code:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 40:8d:5c:38:04:9d brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.100/24 brd 192.168.0.255 scope global eth0
      valid_lft forever preferred_lft forever
    inet6 fe80::428d:5cff:fe38:49d/64 scope link
      valid_lft forever preferred_lft forever

EDIT: 'dmesg' shows this when vpnc is first run
Code:

[ 4314.564362] tun: Universal TUN/TAP device driver, 1.6
[ 4314.564364] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>


willbprog127 12-18-2016 04:15 PM

I'll need to stop using Slackware then, unfortunately. :(

bassmadrigal 12-18-2016 05:38 PM

I have no idea what is happening, but have you tried grepping the source to see if it is calling it directly? Or have you tried removing/renaming the script to prevent the program from calling it up?

/var/log/setup/setup.netconfig

Or have you tried contacting the SlackBuild maintainer to see if they're run into the issue at all? Or contact the actual developers of vpnc?

brobr 12-20-2016 03:42 PM

On my 14.2 (current) box vpnc from SBo runs without a problem. I have never seen that network dialog.... Have you set up vpnc correctly?

In the script I use to start the tunnel the relevant (& first) line is:
Code:

#!/bin/sh
/usr/sbin/vpnc /etc/vpnc/my-vpn.conf

for your own .conf file, the file /etc/vpnc/default.conf can be copied but then needs to be completed with <your relevant details>
Code:

IPSec gateway <gateway>
IPSec ID <group-id>
IPSec secret <group-psk>
IKE Authmode hybrid
Xauth username <username>
Xauth password <password>

good luck,

Rob

willbprog127 12-27-2016 01:05 PM

Quote:

Originally Posted by bassmadrigal (Post 5643695)
Or have you tried contacting the SlackBuild maintainer to see if they're run into the issue at all? Or contact the actual developers of vpnc?

I contacted the SBo maintainer a week or two ago and they have not replied.

I have tried compiling the upstream version of vpnc and the problem still exists. I have compiled upstream's version on other platforms and distros and it does not do this.

Thanks

willbprog127 12-27-2016 01:07 PM

Quote:

Originally Posted by brobr (Post 5644440)
On my 14.2 (current) box vpnc from SBo runs without a problem. I have never seen that network dialog.... Have you set up vpnc correctly?

Thanks for the info.

I have set up vpnc properly. My config has not changed for years. My config works fine on every other Linux and BSD distro, just not Slackware. My network was properly set up at installation time and I have no other issues, only this one.

Thanks :D

brobr 12-27-2016 01:31 PM

Quote:

Originally Posted by willbprog127 (Post 5646841)
Thanks for the info.
My config works fine on every other Linux and BSD distro, just not Slackware. My network was properly set up at installation time and I have no other issues, only this one.

Well during my upgrade to 14.2/current, my vpnc-config was not changed either; combined with your other distros having no problem with this vpnc set-up it seems that something in your Slackware network set-up prevents calling vpnc directly or that the manner in which you call the vpnc-tunnel is somehow compromised. That network dialog only pops-up when /sbin/netconfig is called; something I do not think is needed once your network connections are set-up. Can you find out where in your vpnc-route /sbin/netconfig gets called?

willbprog127 12-27-2016 01:54 PM

Quote:

Originally Posted by brobr (Post 5646850)
Can you find out where in your vpnc-route /sbin/netconfig gets called?

I don't have a 'vpnc-route' file, however I do have a 'vpnc-script' file. netconfig is mentioned on line 128:

Code:

if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then
        . /etc/functions.sh
        include /lib/network
        MODIFYRESOLVCONF=modify_resolvconf_openwrt
        RESTORERESOLVCONF=restore_resolvconf_openwrt
elif [ -x /sbin/resolvconf ] && [ "$OS" != "FreeBSD" ]; then # Optional tool on Debian, Ubuntu, Gentoo - but not FreeBSD, it seems to work different
        MODIFYRESOLVCONF=modify_resolvconf_manager
        RESTORERESOLVCONF=restore_resolvconf_manager
elif [ -x /sbin/netconfig ]; then # tool on Suse after 11.1    # <<<<<<<<<<<<<<<<<<<<<<<< netconfig MENTIONED HERE <<<<<<<<<<<<<<<<<
        MODIFYRESOLVCONF=modify_resolvconf_suse_netconfig
        RESTORERESOLVCONF=restore_resolvconf_suse_netconfig
elif [ -x /sbin/modify_resolvconf ]; then # Mandatory tool on Suse earlier than 11.1
        MODIFYRESOLVCONF=modify_resolvconf_suse
        RESTORERESOLVCONF=restore_resolvconf_suse
else # Generic for any OS
        MODIFYRESOLVCONF=modify_resolvconf_generic
        RESTORERESOLVCONF=restore_resolvconf_generic
fi

as well as line 498:

Code:

modify_resolvconf_suse_netconfig()
{
        /sbin/netconfig modify -s vpnc -i "$TUNDEV" <<-EOF
                INTERFACE='$TUNDEV'
                DNSSERVERS='$INTERNAL_IP4_DNS'
                DNSDOMAIN='$CISCO_DEF_DOMAIN'
                EOF
}

and line 507:

Code:

restore_resolvconf_suse_netconfig()
{
        /sbin/netconfig remove -s vpnc -i "$TUNDEV"
}

So it appears that the SBo needs to patched to use the right network config program instead of thinking Slackware is Suse. ;)

willbprog127 12-27-2016 02:01 PM

This has resolved the problem (although it's very hackish)

Code:

#if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then
        #. /etc/functions.sh
        #include /lib/network
        #MODIFYRESOLVCONF=modify_resolvconf_openwrt
        #RESTORERESOLVCONF=restore_resolvconf_openwrt
#elif [ -x /sbin/resolvconf ] && [ "$OS" != "FreeBSD" ]; then # Optional tool on Debian, Ubuntu, Gentoo - but not FreeBSD, it seems to work different
        #MODIFYRESOLVCONF=modify_resolvconf_manager
        #RESTORERESOLVCONF=restore_resolvconf_manager
#elif [ -x /sbin/netconfig ]; then # tool on Suse after 11.1
        #MODIFYRESOLVCONF=modify_resolvconf_suse_netconfig
        #RESTORERESOLVCONF=restore_resolvconf_suse_netconfig
#elif [ -x /sbin/modify_resolvconf ]; then # Mandatory tool on Suse earlier than 11.1
        #MODIFYRESOLVCONF=modify_resolvconf_suse
        #RESTORERESOLVCONF=restore_resolvconf_suse
#else # Generic for any OS
        MODIFYRESOLVCONF=modify_resolvconf_generic
        RESTORERESOLVCONF=restore_resolvconf_generic
#fi


ponce 12-27-2016 02:05 PM

can you please try editing line 128 of /etc/vpnc/vpnc-script like this
Code:

elif [ -x /sbin/netconfig ] && [ ! -f /etc/slackware-version]; then # tool on Suse after 11.1, do not use on Slackware
I'm afraid that there's no better solution than hacking the script, as vpnc seems not maintained very often upstream.

brobr 12-27-2016 02:08 PM

Quote:

I don't have a 'vpnc-route' file, however I do have a 'vpnc-script' file. netconfig is mentioned on line 128:
What is the source of this 'vpnc-script', as I do not think it has a Slackware oriented origin? What you could try is to make sbin/netconfig un-executable in your Slackware (i.e. chmod -x as root) and see whether this helps to bypass your problem on Slackware. Possibly Suse has a similarly named program in sbin that could be needed for setting up vpnc on SUSE but this has nothing to do with SLackware.

Quote:

So it appears that the SBo needs to patched to use the right network config program instead of thinking Slackware is Suse.
No, as that script has nothing to do with Slackware -as it seem s to me- but everything with Suse; and SBo is for Slackware users....

willbprog127 12-27-2016 02:18 PM

Quote:

Originally Posted by ponce (Post 5646866)
can you please try editing line 128 of /etc/vpnc/vpnc-script like this[...]

Thank you. That works quite well. :D

willbprog127 12-27-2016 02:22 PM

Quote:

Originally Posted by brobr (Post 5646867)
[...] that script has nothing to do with Slackware -as it seem s to me- but everything with Suse; and SBo is for Slackware users....

I think we have our wires crossed. When that part of the script finds 'netconfig' it assumes that Slackware is actually Suse, which is obviously incorrect. With ponce's change to that line of code, it now does not assume that I'm running Suse, and doesn't try to run 'netconfig'. It falls through to the appropriate part of the condition testing and uses that instead.

brobr 12-28-2016 07:41 AM

It was not clear from your post what other linux-es you were running. If you look into it a bit more my proposed work-around would do the same although netconfig on slackware wouldn't work. Ponce's solution is making your script unworkable on Suse. If you happen to run that distribution while using that same script your vpnc-problem might happen there.


All times are GMT -5. The time now is 04:46 PM.