SF Project - nvcables

Here is the new home of my SorceForge nvcables Project web pages.

What is NVCables?

NVCables is a Linux shell (bash) script that sets up a pptp client connection and changes default route on a machine to the created ppp tunnel, effectively connecting the machine online via another gateway. It is used for connecting a Linux machine through cables Service Providers that have a plain LAN-like (DOCSIS) infrastructure, those that require a PPTP dial-up authenticated connection to get online. It uses a precompiled PPTP client binary. This script is adapted for Netvision ISP.

This script is based on the original script made by ERROR404.

The problem in original script was…

/sbin/route add -host cable.netvision.net.il gw $CABLEGW
./pptp-linux cable.netvision.net.il debug user $USERNAME mtu 1460 mru 1460 defaultroute

The above creates a problem if the cable.netvision.net.il hostname gets resolved to multiple ip addresses (using round-robin DNS) and isn’t cached. The two commands might obtain a different ip address. So, the solution was to resolve that hostname once and assign the retrieved ip address to a variable used all along the script (”caching” it manually), e.g.:

	NVGW=$(ping -c 3 -w 3 $PPTPS | head -n 1 | cut -d" " -f3 | cut -d"(" -f2 | cut -d")" -f1)
	CABLEGW=$(route -n | grep 0.0.0.0 | cut -d" " -f10 | tail -1)

route add -host $NVGW gw $CABLEGW dev $IFACE
./pptp $NVGW debug user $USERNAME mtu 1380 mru 1380 defaultroute persist nobsdcomp usepeerdns

Just a simple, little patch. That works.

SourceForge.net Logo