Click to See Complete Forum and Search --> : KRDC won't connect using ppp0


acid45
01-20-2009, 10:01 PM
Hey everyone,

I have tried figuring out how to get KRDC to use my VPN connection to connect but I can't find anything in the configurations. Once I connect to the VPN,

If I run ping -c 5 -I ppp0 work-machine-ip there is an obvious connection. But if I use the come command and replace the IP with the machine name I get unknown host. I figure that's an issue with DNS not taking the VPN DNS settings into account. If I remote from the work laptop running Windows XP I can use the mchine anme. This isn't the issue.

The problem is that no matter what I try I can't get KRDC to connect using RDP to the machine at windows. I ran a tcpdump using tcpdump -i ppp0 -vv and I captured 2 packets in the span of about 5 minutes.

I was wondering if anyone knew how to set KRDC to connect to a machine and specify the interface it should use, IE ppp0.

[edit]
For some reason I though I was using rdesktop but I didn't see it in the kmenu. I found out that I did install it and I had connected using some form of RDP client. Not sure if it was krdc or rdesktop or anything else. I wish I could figure this damn thing out so if I lose the company laptop I can still work from home.

bwkaz
01-21-2009, 12:39 AM
I have tried figuring out how to get KRDC to use my VPN connection to connect but I can't find anything in the configurations. Wrong layer. :p

KRDC, rdesktop, and all other RDP client programs should never need to specify explicit interfaces (in fact, the socket interface that they use does not likely even allow them to do so -- but if it does, through setsockopt or ioctl or something, that's still the wrong solution).

What you need to do is fix your machine's routing tables when the VPN connection is up. Make the packets go through ppp0 (e.g. by setting the other end as your default gateway, or by adding an explicit route to the proper subnet, or something) when they're going to the destination IP that you're concerned about.

If I run ping -c 5 -I ppp0 work-machine-ip there is an obvious connection. What happens if you get rid of "-I ppp0"? I assume it doesn't work, right? If that's true, then use this as a test for fixing your routing table: once you make changes to the routing table to make this work, rdesktop or KRDC or whatever should work as well.

But if I use the come command and replace the IP with the machine name I get unknown host. I figure that's an issue with DNS not taking the VPN DNS settings into account. Yeah, likely. Change /etc/resolv.conf manually, or get the PPP server on the other end to specify the DNS server for you, so your pppd will automatically update that file. Either way.

The problem is that no matter what I try I can't get KRDC to connect using RDP to the machine at windows. I ran a tcpdump using tcpdump -i ppp0 -vv and I captured 2 packets in the span of about 5 minutes. What about other interfaces? Actually, what about the "all" pseudo-interface? (That one is all traffic entering or leaving the machine, though it won't work in promiscuous mode. That shouldn't matter here though.) Capturing on the "all" interface won't directly tell you which interface the packets are leaving on, but the source (or destination) MAC address should let you figure it out. :)

Does your ppp0 interface have an IP address on the same subnet as the rest of the work network? Or is the PPP connection over a pair of addresses (/30 or /31 subnet mask)? If it's a pair, then you probably just need to add an explicit route to the entire work subnet, set to route via the PPP peer's IP. Something like:

/sbin/ip route add 172.16.0.0/16 via 192.168.128.254

assuming that ppp0 has an address of 192.168.128.253, and a /30 subnet mask (so .254 is the peer's IP), and assuming that the work network is 172.16.0.0/16. Substitute as appropriate.

I was wondering if anyone knew how to set KRDC to connect to a machine and specify the interface it should use, IE ppp0. Don't. That's supposed to be left up to the machine's routing table, not the various applications that use sockets. (I'm not surprised that ping has the option, but ping is a much lower level program than almost anything else. It doesn't use the normal IP layer; it generates packets manually and sends them out a given interface using the PF_RAW socket type. But normally it looks up the interface name from the routing tables...)

Once the routing table says "packets going to the work network need to be routed out the ppp0 interface, and possibly via the appropriate gateway", everything should work fine.