route table is ALWAYS nonsense after PPTP connection from network-manager-pptp

Bug #303706 reported by Wenyu Zhang
2
Affects Status Importance Assigned to Milestone
network-manager-pptp (Ubuntu)
New
Undecided
Unassigned

Bug Description

Dear developers,

I tried to connect to my school with network-manager-pptp, but there was no traffic after the connection. The following is my attemption to fix the problem.
-----------------------------------------------
hearson@hearson-laptop:/etc/ppp$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 ath0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
hearson@hearson-laptop:/etc/ppp$ sudo route del default
hearson@hearson-laptop:/etc/ppp$ ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
          inet addr:128.210.192.137 P-t-P:128.210.192.137 Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1
          RX packets:421 errors:0 dropped:0 overruns:0 frame:0
          TX packets:521 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:105108 (105.1 KB) TX bytes:140946 (140.9 KB)

hearson@hearson-laptop:/etc/ppp$ sudo route add default gw 128.210.192.137 ppp0
hearson@hearson-laptop:/etc/ppp$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 ath0
0.0.0.0 128.210.192.137 0.0.0.0 UG 0 0 0 ppp0

hearson@hearson-laptop:/etc/ppp$ ping 208.67.222.222
PING 208.67.222.222 (208.67.222.222) 56(84) bytes of data.
64 bytes from 208.67.222.222: icmp_seq=1 ttl=54 time=263 ms
64 bytes from 208.67.222.222: icmp_seq=2 ttl=54 time=263 ms
^C
--- 208.67.222.222 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1006ms
rtt min/avg/max/mdev = 263.088/263.229/263.370/0.141 ms
------------------------------------------------

Meanwhile, before I start PPTP connection, I modified my /etc/ppp/ip-up like this
================================================
#!/bin/sh
#
# This script is run by the pppd after the link is established.
# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes,
# set IP address, run the mailq etc. you should create script(s) there.
#
# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named
# after that package), so choose local script names with that in mind.
#
# This script is called with the following arguments:
# Arg Name Example
# $1 Interface name ppp0
# $2 The tty ttyS1
# $3 The link speed 38400
# $4 Local IP number 12.34.56.78
# $5 Peer IP number 12.34.56.99
# $6 Optional ``ipparam'' value foo

# The environment is cleared before executing this script
# so the path must be reset
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH

# These variables are for the use of the scripts run by run-parts
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM

# as an additional convenience, $PPP_TTYNAME is set to the tty name,
# stripped of /dev/ (if present) for easier matching.
PPP_TTYNAME=`/usr/bin/basename "$2"`
export PPP_TTYNAME

# If /var/log/ppp-ipupdown.log exists use it for logging.
if [ -e /var/log/ppp-ipupdown.log ]; then
  exec > /var/log/ppp-ipupdown.log 2>&1
  echo $0 $*
  echo
fi

# This script can be used to override the .d files supplied by other packages.
if [ -x /etc/ppp/ip-up.local ]; then
  exec /etc/ppp/ip-up.local "$*"
fi

run-parts /etc/ppp/ip-up.d \
  --arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"

# if pon was called with the "quick" argument, stop pppd
if [ -e /var/run/ppp-quick ]; then
  rm /var/run/ppp-quick
  wait
  kill $PPPD_PID
fi

env >/route.txt
route -n >>/route.txt
route del default
route add default gw $IPLOCAL dev $IFNAME
route -n >>/route.txt
================================================

Thus, I attempted to correct the route table after the PPTP connection was established. And the /route.txt is,
================================================
PPP_TTY=
DNS1=128.210.11.57
IFNAME=ppp0
DNS2=128.210.11.5
IPLOCAL=128.210.192.137
PPPLOGNAME=root
PPP_REMOTE=128.210.239.21
PPP_IFACE=ppp0
PPP_TTYNAME=
ORIG_UID=0
USEPEERDNS=1
SPEED=38400
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
IPREMOTE=128.210.239.21
PPP_LOCAL=128.210.192.137
PPP_IPPARAM=nm-pptp-service-8623
PPPD_PID=8626
PWD=/
PPP_SPEED=38400
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 ath0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 ath0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
128.210.239.21 192.168.0.1 255.255.255.255 UGH 0 0 0 ath0
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 ath0
0.0.0.0 128.210.192.137 0.0.0.0 UG 0 0 0 ppp0
===============================================

You can see the route table became correct for a while when it was still running the scripts. After that, the route table immediately became nonsense (no matter whether I modified the `ip-up' script or not).

My system is up-to-date. Please help me get rid of this situation. Thanks a lot!

Tags: pptp route
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.