>>> I have a cable modem connection to the internet which works just
>>> great but I have to use dial-up to access the FTP service of one
>>> of my web hosting companies. The first two lines of the output of
>>> ifconfig for the PPP connection is like this (exact IP addresses
>>> vary, of course):
>>> ppp0 Link encap:Point-to-Point Protocol
>>> inet addr:212.134.22.23 P-t-P:195.40.10.8 Mask:255.255.255.255
>>> What do I need to type at the command line after dial-up so that
>>> all my FTP access goes through the dial-up modem and everything
>>> else goes through the cable modem?
>> If only one IP address is to be used for the ftp access then entering
>> route add ip_address_for_ftp ppp0
>> to create a host route should do it. You'll need to be sure the pppd
>> defaultroute option is not used.
> Not sure if that would work unless dialing directly to the ftp server (in
> which case host route would already exist), since it is likely NOT a
> directly connected IP and best to be more specific. It would need a -host
How can you be more specific than a host route?
A host route assures that any traffic for the specified host will go
out via that route and reach the peer. If the peer is the ftp server
then, as you point out, the route already exists (but no harm is done
by attempting to establish it twice).
If the peer is one that provides indirect access (e.g. Internet) then
the ftp traffic will be sent to it and passed to the web-site host, but
no other traffic will go out the PPP interface - except traffic sent to
the peer itself via the host route automatically established by pppd.
Quote:> or -net route to that ftpd IP or network using remote ppp IP as gateway
> (gw). Since pppd typically automatically adds a host route to remote ppp
> IP it would just need:
> route add -host ftpd_ip gw 195.40.10.8 dev ppp0
How is this more specific? You can manually replace 195.40.10.8 with
any non-local IP address and it would make no difference, i.e., adding
"gw 195.40.10.8" does nothing to make the routing more specific.
Quote:> (or -net route with proper netmask if needed to reach other machines
> on that network). Also see below.
I can't think of any reason why a network route would be necessary
in this case unless he needs access to several web hosts for the same
company on a particular subnet. It seemed to me that he needed access
to only one, but if he needs access to several hosts at one company then
one network route might be appropriate. Another alternative would be
to add a host route for each of his web-site hosts there.
Quote:>> In the absence of a compelling reason not to do so, it would be easier
>> to add the line
>> /sbin/route add ip_address_for_ftp $1
>> to /etc/ppp/ip-up (or to ip-up.local for some distributions) than it
>> would be to enter the route at a command line after each PPP connection
>> is established.
> Or better:
> /sbin/route add -host ftpd_ip gw $5 dev $1
> (or -net route with netmask)
If you are going to add a network route, that "or" can be important in
these days of CIDR (although traffic to, say a classful C network, that
was not meant for a web-site host in a subnet of it would be unlikely).
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* The signal-to-noise ratio is too low in many [news] groups to make
* them good candidates for archiving.
* --- Mike Moraes, Answers to FAQs about Usenet */