Re: dialup solution (as seconary connection / iptables )



sammy <sambo@xxxxxxxxxxxx> wrote:
Clifford Kite wrote:

To try and find out what is wrong the dialout program or script should
be set for verbose logging, for chat that would be -vs. Then you can add

daemon.*;local2.* /var/log/ppp.log


It works when pppd is setup for script but doesn't run ip-up/down.

Sorry, "setup for script" doesn't ring any bells. But the modem
connection must complete before pppd can bring up the PPP link and so
run ip-up/ip-down.

If you use the Linux box and route the news IP address to it on each
of the other LAN boxes then you shouldn't need to disable the NIC.
DSL and dialup PPP can both be available at the same time.

On the dialup host you would need IP forwarding enabled and

route add news.ip.num gw $5 $1
iptables -t nat -A POSTROUTING -o $1 -j SNAT --to-source $4

in up-up, with no default route for the PPP interface if you want to
also be able to access the Internet with other types of connections
from the dialup via DSL routing.

On the other LAN hosts you should only need

route add news.ip.num gw 192.168.0.6 ethx

where 192.168.0.6 (or whatever) is the LAN IP address of the dialup and
ethx is the host's Ethernet interface. Of course news.ip.num is the IP
address of the external news server.


As far as I know you can only route through machine directly connected
and in my case directly connected to all machines is the netgear
concentrator (since it's routing capability is questionable )

Can the machines on the LAN talk with one another? If so then it seems
to me that the routings suggested should work. They both say essentially
"if the packet is for news.ip.num then send it to the designated gateway."

In the first instance the gateway is the PPP server and in the second
it's the dialup host. In both instances the packet should be sent, the
first instance because the interface is a PPP connection to the server and
the second because the gateway is in the same network as the sending host.

When I make ppp connection one of the messages is:
"not changing default route" (through the router)

That's an informational message from pppd. Pppd sees a default route
already set and refuses to override it with one of it's own. IIRC that
is the case even with the pppd defaultroute option.

I guess that's something to reconsider since I am not expectiong
to work from that machine but may wish to share drive space.

It's not clear to me how a default route affects sharing drive space.

This is more or less what I would like to run from ip-up when I get it
going.

news.sh $4 $5

#!/bin/sh
echo "adding " $1 >/dev/tty0

I think you may really want this message to appear on the terminal from
which pppd is launched. If so then you should use something like

export TTY=$(tty); news.sh $4 $5

in ip-up and use

echo "adding " $1 > $TTY

in news.sh instead of the echo to /dev/tty0. Unless you know echo
redirection to /dev/tty0 works for you of course. :)

route add news.serv1 $2
route add news.serv2 $2

This doesn't make sense to me. Does route really know what to do with the
second IP address ($2)?

iptables -t nat -A PREROUTING -p tcp -d 192.168.0.6 --dport 119 -j LOG
--log-tcp-sequence
iptables -t nat -A PREROUTING -p tcp -d 192.168.0.6 --dport 119 -j DNAT
--to-destination news.serv2

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

This can substitute for SNAT since MASQ is just automatic SNAT in the
sense that the --to-source IP address selected is that of the outbound
interface.

should second rule (DNAT) be in INPUT chain?

"man iptables" says DNAT is only permitted in the PREROUTING and OUTPUT
chains and user defined chains called from those chains. But I'm not
sure that the second rule will work since the packet has arrived on the
destination IP address's interface. The DNAT examples I've seen are for
packets that come in on one interface and are forwarded through another
interface to the destination host.

This gets packets back to the modem server but I am not
sure how to procceed from here since there are 2 possible clients,
(...5 and ...9 ) short of hardcoding it for one of them with

iptables -t NAT -A INPUT -s news.serv1 -j DNAT --to-destination
192.168.0.9

or ...5

Do I need to mark the connection or ..?

There's a lot I don't know about iptables and I've never used DNAT.
That's why my suggestions included routing that I think should work
instead of DNAT.

--
Clifford Kite
/* ... packets usually cross many administrative boundaries on their way
from a source to a destination and often the only point of agreement
between those separate administrations is that all problems are someone
else's fault. --Van Jacobson, abstract of April 97 MSRI talk */
.



Relevant Pages

  • Re: ipv4 regression in 2.6.31 ?
    ... host A ping 192.168.2.1 everything works. ... interface eth1 on host B and let host A ping 192.168.2.1 you get no reply. ... Each incoming packet is tested against the FIB and if the interface ... Kernel 2.6.30.X and below work flawlessly in this setup, ...
    (Linux-Kernel)
  • Re: Point-to-Point links - route IP Block with DSL
    ... Subnet mask: 255.255.255.248 ... I can see from above that if the route table fails to find ... Yes, it is a host route, with no subnet. ... the PPP interface gets all traffic from your ...
    (comp.os.linux.networking)
  • Re: ipv4 regression in 2.6.31 ?
    ... host A ping 192.168.2.1 everything works. ... interface eth1 on host B and let host A ping 192.168.2.1 you get no reply. ... Each incoming packet is tested against the FIB and if the interface ... Current recommended practice in RFC3704 is to enable strict mode ...
    (Linux-Kernel)
  • Re: Forcing a particular IP address out to an interface
    ... > lo device regardless of what is in the route table. ... pretend that the ppp0 interface on the 'left' box has IP ... the packet somewhere along its route. ... packet to alter the destination address to 192.168.1.23 ...
    (comp.os.linux.networking)
  • Re: sent an invalid ICMP type 11, code 0 error to a broadcast: 0.0.0.0 on lo?
    ... > If you ping an IP address on your computer, ... > the lo route filtering altogether. ... ICMP packet, with source address on this same box. ... IF that packet comes from the interface where the default ...
    (Linux-Kernel)