On 05/06/2016 04:43 AM, Pascal Hambourg wrote:
Le 05/05/2016 21:05, ken a écrit :Working on the Pi just from the bash prompt as root, how do I set the routing table (etc.) to connect directly to the DSL modem? The routing table on my router currently shows: # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 77.219.160.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 77.219.160.1 0.0.0.0 UG 0 0 0 ppp0 Here's the Pi's current routing table: Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 10.10.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 To plug the Pi directly into the modem, I think I'm going to need to run ppp and then run some commands to temporarily set the IP address of the ethernet port (eth0) and the routing table. I much prefer to do all this without changing config files so that when I reboot the Pi, the settings go back to their original. What do I need to 'apt-get' for the ppp executables?The interface type is PPP so you need the package "ppp" providing pppd.The DSL provider probably uses PPP over Ethernet (PPPoE). You can check on your router. pppd can handle PPPoE direclty through a plugin and a kernel module or in userland though the package "pppoe" (more overhead and more options). The extra package "pppoeconf" eases the creation of a PPPoE configuration file in /etc/ppp/peers. Once created, the connection can be started and stopped manually with "pon" and "poff".Some DSL providers may use the PPTP protocol instead. Then you need the package "pptp-linux".
Thanks for the very helpful reply.The router is a dd-wrt, set up years ago and I don't recall anymore how I set it up. So I called the ISP: they said they use pppoe. I installed that on the Pi... along with ppp.
And... I'm more accustomed to using the 'route' command to manually set up a routing table, but have used 'ip' commands too, if that's more familiar to you.You should not need to issue any commands. Just make sure the PPP config file has the options "defaultroute" to set the default route through the PPP connection and "replacedefaultroute" to override the existing default route.
I *want* to use commands. As said in my original (& probably seemingly wordy, hence redacted) email, this is going to be temporary use of this Pi, so I don't want to set up a new configuration on it. I want the default networking configuration to remain as is, plug it into a different connection, run some commands to change the networking to run ppp, and then, when I'm done with this new connection, reboot and go back to the previous networking config which doesn't even run ppp.
Reading "man pon" I found I can do "pon testconfig" and pon will load the specified "testconfig" settings file instead of the default config... and then after a reboot, go back to the previous network settings (with no ppp running and the default route to what it was previously).
Said another way, this Pi is currently just part of my LAN and is configured to connect to a router (192.168.0.1). I'm going to unplug it from that, connect it directly to the DSL modem (temporarily) to test my ISP. Then, when I'm done with the test, I'll unplug it, put it back onto the LAN, and boot into it's previous network config.
So I expect that, after the Pi is connected directly to the modem, I'll need to do "ifdown eth0" first, then do "pon testconfig". The /etc/ppp/peers/testconfg file is going to be somewhat different from the default one... on these items:
1) I have static ip addresses (2 of them), not dynamic. So where, if anywhere, do I need to specify one? And what other setting(s) to specify a static IP?
2) My setup needs to specify a user and password. I'm guessing the 'user "myusername@realm"' line should serve for that, yes?
3) The Pi has two network interfaces (shown above, in my original post). How do I tell ppp to use eth0 and leave wlan0 alone?
This is actually a cool, little project... might be helpful for other folks who want to run tests on their ISP isolated from their LAN. Again, thanks for your help.