- Sections
- Misc.
Switching between Lan and Dialup
I use my laptop mostly on my local network with either a Melco wireless pcmcia card, or a 3Com Fast Ethernet pcmcia card. However sometimes I need to use dial up (such as when my cable service is down, or when I am travelling), and it is possible that both dial up and LAN connections could both be connected.
So I need kppp to change the DNS settings, and also to change the default route of my laptop. This last function is not performed properly by kppp requiring a little 'tweak' to make it work reliably.
Kppp setup
In the 'Account setup' of kppp set the checkbox for 'Default gateway' and 'Assign default route to this gateway' In the 'DNS Setup' screen set 'Domain name' = name of your domain. In my case this is localdomain. Check the box for 'Disable existing DNS servers' - This will disable the default DNS setup, and will add the ISP's DNS server addresses to /etc/resolv.conf during the dial up call.
Create a file /etc/ppp/if-up.local with the contents
#!/bin/bash #reassign default route when on dial up route del default route add default dev ppp0
Make this file executable with 'chmod 755 /etc/ppp/if-up.local' Create another file called /etc/ppp/if-down.local containing
#!/bin/bash #make eth0 boss after dial up ifup eth0
Make this file executable as well 'chmod 755 /etc/ppp/if-down.local'
Now when you use kppp to dial the default route will be switched to use the dial up connection. The Lan will still work, but only for local traffic. On disconnection of the dial up connection, the Lan will once again become the gateway to the Internet.
Thursday 22nd April 2004

