(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 26 Feb 2021, 23:46
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
HowTo!!! Verify that your VPN is hooking you up correctly
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 2 of 3 [32 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Sat 28 Dec 2019, 04:43    Post subject:  

@OscarTalks nice catch. I been busy to little time to work, I should have seen it did not show "NO Network". Funny I did test yours and found it did not work for me. That is why I made some changes. And now I also realize I did not say anything. Sorry. I need to be more alert in the future.

For the record grep "state UP" -A2 does work for me.

I am using BusterDog64. Ip Vesion
Code:
root@live:~# ip -V
ip utility, iproute2-ss190107


With network I get
Code:
root@live:~# ip address show | grep "state UP" -A2 | grep inet | echo $?
127


Without Network I get
Code:
root@live:~# ip address show | grep "state UP" -A2 | grep inet | echo $?
0


So after the correction if [ -z "$UpLink" ]; All work fine with me.

Let me see if I had time today for the rotate ovpn script. See I am using you guys jafadmin & OscarTalks as an excuse to learn bash. I do write in C but bash is for the most part new to me. Do not get me wrong I can follow a program. Writing one from of my own is another story. HEHEHEHE
Back to top
View user's profile Send private message 
OscarTalks


Joined: 05 Feb 2012
Posts: 2202
Location: London, England

PostPosted: Sat 28 Dec 2019, 17:30    Post subject:  

The string "state UP" is present in BionicPup32 so it works.
Unfortunately not so in Stretch and not in Wheezy either.
The executable ip is a symlink to busybox in all cases

Stretch with no VPN
Code:
# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
    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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.14/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
#

Stretch with OpenVPN connected
Code:
# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
    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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.14/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/[65534]
    inet 10.211.1.177 peer 10.211.1.178/32 scope global tun0
       valid_lft forever preferred_lft forever
#

Wheezy with no VPN
Code:
# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0
#

Wheezy with OpenVPN connected
Code:
# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/[65534]
    inet 10.211.1.197 peer 10.211.1.198/32 scope global tun0
#

_________________
Oscar in England

Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 1258

PostPosted: Sat 28 Dec 2019, 18:06    Post subject:  

Thanks, Oscar. I think we can use "MULTICAST,UP" instead. It seems to work on both.

I've changed the script download.

Thanks for the testing. Cool
Back to top
View user's profile Send private message 
foxpup

Joined: 29 Jul 2016
Posts: 1141

PostPosted: Sun 29 Dec 2019, 09:37    Post subject: ... should be used to make a P2P PuppyPhone call?...
Subject description: 2 ports for psip?
 

@enrique very nice instructions for puppyphone with IP!!

enrique wrote:
Now you need to know the Port PuppyPhone is using:
Code:
netstat -peanut | grep psip

When I try this I get 2 ports, 5060 and 5061:
Code:
root# netstat -peanut | grep psip
tcp        0      0 0.0.0.0:5060            0.0.0.0:*               LISTEN      0          91578      29175/./psip64     
tcp        0      0 0.0.0.0:5061            0.0.0.0:*               LISTEN      0          91582      29175/./psip64     
udp        0      0 0.0.0.0:5060            0.0.0.0:*                           0          91575      29175/./psip64
Any idea what this means?
I don't use VPN.
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Sun 29 Dec 2019, 15:31    Post subject:  

To prevent hijack I answer you here Please sugest: Internet Phone SIP
Back to top
View user's profile Send private message 
gabtech

Joined: 14 Apr 2013
Posts: 107

PostPosted: Tue 31 Dec 2019, 06:22    Post subject: New netinfo.yad  

Hi yafadmin

The new netinfo script does not work correctly in stretchdog 32. The old one works correctly. The new scripts produces a No network status while the old script gives me the public ip.
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 1258

PostPosted: Tue 31 Dec 2019, 13:44    Post subject: Re: New netinfo.yad  

gabtech wrote:
Hi yafadmin

The new netinfo script does not work correctly in stretchdog 32. The old one works correctly. The new scripts produces a No network status while the old script gives me the public ip.

There is some kind of difference in the output of the network tools between various versions of Linux.

either the phrase "MULTICAST,UP" or "state UP" should work for the line:
Code:
UpLink=$(ip address show | grep "state UP" -A2 | grep inet|xargs )
UpLink=$(ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs )

Just use whichever works with your version.

Naturally, this has not been tested with ALL versions of puppy linux. That level of testing is beyond my time and resources ..
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Wed 01 Jan 2020, 09:26    Post subject:  

As a report, I did try it on Buterdog64 and bionic32. For mi "MULTICAST,UP" does the job.

gabtech Can you post your result in stretchdog 32 to just
Code:
ip address show

Last edited by enrique on Wed 01 Jan 2020, 19:35; edited 1 time in total
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4481
Location: holland

PostPosted: Wed 01 Jan 2020, 12:15    Post subject:  

Quote:
either the phrase "MULTICAST,UP" or "state UP" should work for the line:
Code:
UpLink=$(ip address show | grep "state UP" -A2 | grep inet|xargs )
UpLink=$(ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs )


On my Stretchdog 32 system:
With ethernet cable plugged in (same output for both):
Code:
root@live:~# ip address show | grep "state UP" -A2 | grep inet|xargs
inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
root@live:~# ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs
inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
root@live:~#


With cable unplugged (first command output is empty):
Code:
root@live:~# ip address show | grep "state UP" -A2 | grep inet|xargs

root@live:~# ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs
inet6 fe80::222:64ff:fe4d:6c17/64 scope link
root@live:~#


EDIT: With cable plugged in, full output of ip address show
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 mq state UP group default qlen 1000
    link/ether 00:22:64:4d:6c:17 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::222:64ff:fe4d:6c17/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1b:77:16:3a:10 brd ff:ff:ff:ff:ff:ff


With cable unplugged:
Code:
root@live:~# ip address show
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: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:22:64:4d:6c:17 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::222:64ff:fe4d:6c17/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1b:77:16:3a:10 brd ff:ff:ff:ff:ff:ff


Fred

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4481
Location: holland

PostPosted: Wed 01 Jan 2020, 13:02    Post subject:  

Following up on previous post, IMO, the best way (and portable between different OS's) to check for network connection is to use curl "<some common website>" in this case using "https://duckduckgo.com" , then in the script:
Code:
### If "$UpLink" is blank we cannot collect info, so exit ..
#if [ -z "$UpLink" ]; then yad --info --timeout=30 --height=100 --width=100 --center --title="Network Status" --text="$(printf "\n\t   NO Network\n")" &
# exit 0
#fi

# check if there is network connection using curl, replacing the above commented out
 case "$(curl -s --retry-delay 3 --retry 3 --max-time 10 -I https://duckduckgo.com | sed 's/^[^ ]*  *\([0-9]\).*/\1/; 1q')" in
  [23]) echo "OK, there is network connection, continue..." ;;
  *) yad --info --timeout=30 --height=100 --width=100 --center --title="Network Status" --text="$(printf "\n\t   NO Network\n")" &
 exit 0 ;;
 esac


Fred

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
ETP


Joined: 19 Oct 2010
Posts: 1202
Location: UK

PostPosted: Wed 01 Jan 2020, 18:41    Post subject:  

Choice is a fine thing.
Here is a link to a dynamic utility to give an on-screen display.

http://murga-linux.com/puppy/viewtopic.php?p=978652&search_id=2005232242#978652

(Requires basic conky)
EDIT: 4th January 2020 - Please note that it is not suitable for use with Debian Dogs.

_________________
Regards ETP

Kennels

Last edited by ETP on Sat 04 Jan 2020, 10:17; edited 1 time in total
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Wed 01 Jan 2020, 19:55    Post subject:  

I am on BusterDog64 and it has Conky as default. I try to manually install but show nothing. One thing is missing "/root/.config/wallpaper/bg_img" where can I find this?

Edit: After doing conkytogle I have NET:EXT: ***.***.*** over IP(wlan0): ###.###.###. But this value never gets updated if I start VPN or STOP?

What I am doing wrong?
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3475
Location: The Blue Marble

PostPosted: Thu 02 Jan 2020, 07:28    Post subject:  

My version, as a way to say thanks. May this be useful for those who need it.

Code:
#!/bin/sh
# Inspiration: http://murga-linux.com/puppy/viewtopic.php?t=117675

TMP=/tmp/ipinfo.$$
cat > $TMP << EOF
Local IP Address(es)
--------------------
$(
ifconfig | sed -n '/^[a-z].*:/ {s/:.*/:/; N; /inet /!d; s/:.*inet /: /; s/[ ]*netmask.*//; H}; ${x;s/^\n//;p}'
)

Remote IP address
-----------------
$(curl -s https://geoip.ubuntu.com/lookup | xml2 | sed 's|/Response/||; s/=/: /')
EOF

[ -z "$DISPLAY" ] && cat "$TMP" ||
Xdialog --fixed-font --title "Network Info" --no-cancel --editbox "$TMP" 0 0 2> /dev/null
rm -f $TMP

For this to work, you need "xml2" which "flattens" XML to a line-oriented format (which then you can process with grep/sed/awk/etc). The original source of this small nifty utility has been blown away by time, but fortunately Debian folks keeps a copy for us.

_________________
Fatdog64 forum links: Latest version | Contributed packages | ISO builder
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Thu 02 Jan 2020, 10:46    Post subject:  

@jamesbond Your script works very nice. One more sample for my collections.

Now to be honest YOU MADE MY DAY. I like to work in many projects. One of then was in Real Need of your suggested xml2. As this too parse also HTML. So THANK YOU.
Back to top
View user's profile Send private message 
ETP


Joined: 19 Oct 2010
Posts: 1202
Location: UK

PostPosted: Thu 02 Jan 2020, 10:51    Post subject:  

enrique wrote:
I am on BusterDog64 and it has Conky as default. I try to manually install but show nothing. One thing is missing "/root/.config/wallpaper/bg_img" where can I find this?

Edit: After doing conkytogle I have NET:EXT: ***.***.*** over IP(wlan0): ###.###.###. But this value never gets updated if I start VPN or STOP?

What I am doing wrong?

Hi enrique,
Sorry my fault, I did not realise that you were using BusterDog64.
The .pet I linked to is only suitable for Pups such as Bionicpup64 8.0
and easyos.

_________________
Regards ETP

Kennels
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [32 Posts]   Goto page: Previous 1, 2, 3 Next
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0864s ][ Queries: 13 (0.0187s) ][ GZIP on ]