I want a Network Manager, VPN Client in Freebsd.

Your openconnect command should configure it properly:
Code:
$ sudo openconnect --interface=tun0 --user=camel cs3.ilcvpn.info:510
That not changed.

# ifconfig tun0
Code:
tun0: flags=8011<UP,POINTOPOINT,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    groups: tun 
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
Last edited by a moderator:
$ sudo openconnect --interface=tun0 --user=camel cs3.ilcvpn.info:510
Code:
POST https://cs3.ilcvpn.info:510/
Connected to 69.175.34.157:510
SSL negotiation with cs3.ilcvpn.info





SSL connection failure
Failed to open HTTPS connection to cs3.ilcvpn.info
Failed to obtain WebVPN cookie

It will be cut off after a few seconds.

Q: Did you connected to VPN?
Q: It works for you?
Q: you tested your new ip after connected?

because it has limited connection on 2 person.
 
Last edited by a moderator:
No, I disconnected right after checking.
Now I connected again. It pings 10.10.0.1 for 2 minutes with 35-40ms.
I don't see any issues.
 
Code:
root@Unix:/tmp # ifconfig tun create
tun1

Code:
root@Unix:/tmp # ifconfig tun1
tun1: flags=8010<POINTOPOINT,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    groups: tun 
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Code:
root@Unix:/tmp # ifconfig tun0
tun0: flags=8011<UP,POINTOPOINT,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    groups: tun 
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Code:
root@Unix:/tmp # ifconfig tun2
ifconfig: interface tun2 does not exist

---------------------
Next Step :


Code:
$ sudo openconnect --interface=tun1 --user=camel cs3.ilcvpn.info:510
POST https://cs3.ilcvpn.info:510/
Connected to 69.175.34.157:510
SSL negotiation with cs3.ilcvpn.info


root@Unix:/tmp # ifconfig tun1
Code:
tun1: flags=8010<POINTOPOINT,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    groups: tun 
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
Last edited by a moderator:
It is UP:

Ooops! yeah its up. :):cool:

--------- update

but it not works.
also: when I press or type ^C in openconnect. (it will exit)

next: The tun0 is up yet.


Code:
$ curl 'https://api.ipify.org?format=json'
{"ip":"31.56.89.79"}
 
Last edited by a moderator:
i think myself make it as up.
ifconfig tun0 up
You can check history in the first page of this thread.
 
Note:
OpenConnect
not ask me to accept the SSL, but it ask from you. (in the first page of this thread)
but it not ask me. (even when i not use --crt argument)
 
vpn.sh file:

Code:
#!/bin/sh

# settings
user="camel"
pass="camel"
host="cs4.ilcvpn.info:510"
test="nc -v -w 10 -z 172.16.0.4 3389" # i think its wrong!(ip should change...)
tmpif="tun1"
iface="ocvpnc1" # i dont know why it?!
pidfile="/tmp/${iface}.pid"
script="/usr/local/sbin/vpnc-script"

# env
openconnect="/usr/local/sbin/openconnect"
ifconfig="/sbin/ifconfig"

# func
ifkill()
{
        $ifconfig "$1" down 2>/dev/null || :
        $ifconfig "$1" destroy 2>/dev/null || :
}

# check if we're already running
#if [ -n "$test" ] && $test; then
        echo "Connection is already up"
#        exit 0
#fi

# clean up previous instance, if any
if [ -e "$pidfile" ]; then
        read pid <"$pidfile"
        echo "Killing previous pid: $pid"
        kill -TERM "$pid"
        rm "$pidfile"
fi
ifkill "$tmpif"
ifkill "$iface"

# open vpn connection
echo "$pass" |\
$openconnect \
        --background \
        --pid-file="$pidfile" \
        --interface="$tmpif" \
        --user="$user" \
        --passwd-on-stdin \
        --script="$script" \
        "$host"

# rename the interface
if [ "$iface" != "$tmpif" ]; then
        echo "Renaming $tmpif to $iface"
        $ifconfig "$tmpif" name "$iface"
fi

Code:
$ sh vpn.sh
Connection is already up
POST https://cs4.ilcvpn.info:510/
Connected to 69.175.34.158:510
SSL negotiation with cs4.ilcvpn.info
....
....
after some seconds...

SSL connection failure
Failed to open HTTPS connection to cs4.ilcvpn.info
Failed to obtain WebVPN cookie
Renaming tun1 to ocvpnc1
ifconfig: ioctl SIOCSIFNAME (set name): Operation not permitted

----------------

Code:
$ sudo sh vpn.sh
Password:
Connection is already up
POST https://cs4.ilcvpn.info:510/
Connected to 69.175.34.158:510
SSL negotiation with cs4.ilcvpn.info

It not works, and not change the ifconfig status.
 
Last edited by a moderator:
Back
Top