[arch-general] Switching between Internet connections
Hello, My laptop is connected to a LAN with Internet connection and it gets the IP stuff (address, routing, dns) via dhcp using the default systemd scripts on boot. I also have a 3G modem (USB) which I have created the ppp scripts to connect based on the Wiki article https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd Both connections work fine, except after switching to modem from LAN some applications (pidgin, xchat, ect. which were running) still uses the DNS nameserver from previous connection (LAN) meaning they still trying to send DNS queries to LAN router (which is not reachable at that time). This gets fixed after that application is closed and reopened. Is this behavior normal or a bug? Thanks. P.S. To disconnect/connect from LAN I either use:
# systemctl stop dhcpcd@wlan0 # systemctl start dhcpcd@wlan0 or # dhcpcd -k wlan0 # dhcpcd wlan0
To disconnect/connect I use poff/pon commands and the scripts are setup exactly as described on the Wiki. -- Sudaraka Wijesinghe.
On Friday 07 December 2012 13:02:12 Sudaraka Wijesinghe wrote:
Hello,
My laptop is connected to a LAN with Internet connection and it gets the IP stuff (address, routing, dns) via dhcp using the default systemd scripts on boot. I also have a 3G modem (USB) which I have created the ppp scripts to connect based on the Wiki article https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
Both connections work fine, except after switching to modem from LAN some applications (pidgin, xchat, ect. which were running) still uses the DNS nameserver from previous connection (LAN) meaning they still trying to send DNS queries to LAN router (which is not reachable at that time). This gets fixed after that application is closed and reopened.
Is this behavior normal or a bug?
If I understood it correctly, it is normal. The applications you mention establish TCP connections using the IP address available at the time you launch them as the IP source address. If you later "switch" interface to connect to the Internet (and hence change your IP address), that address is no longer available and hence the TCP connection is broken. You can only restart the application, so that a new TCP connection is established using the new IP address. There are solutions to such a problem (e.g., HIP - Host Identity Protocol), but they are not yet deployed. Bests, Stefano
Thanks.
P.S.
To disconnect/connect from LAN I either use:
# systemctl stop dhcpcd@wlan0 # systemctl start dhcpcd@wlan0
or
# dhcpcd -k wlan0 # dhcpcd wlan0
To disconnect/connect I use poff/pon commands and the scripts are setup exactly as described on the Wiki.
why don't you add public ns to your resolv.conf? ex. nameserver 8.8.8.8 nameserver 8.8.4.4
On Fri, 07 Dec 2012 13:02:12 +0530 Sudaraka Wijesinghe <sudaraka.wijesinghe@gmail.com> wrote:
Hello,
My laptop is connected to a LAN with Internet connection and it gets the IP stuff (address, routing, dns) via dhcp using the default systemd scripts on boot. I also have a 3G modem (USB) which I have created the ppp scripts to connect based on the Wiki article https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
Both connections work fine, except after switching to modem from LAN some applications (pidgin, xchat, ect. which were running) still uses the DNS nameserver from previous connection (LAN) meaning they still trying to send DNS queries to LAN router (which is not reachable at that time). This gets fixed after that application is closed and reopened.
Is this behavior normal or a bug?
I think it is normal. If you suspect DNS is the problem, just use a static resolv.conf with google/comodo dns nameservers (add "nohook resolv.conf" to /etc/dhcpcd.conf to forbid dhcpcd to touch the file).
Thanks.
P.S.
To disconnect/connect from LAN I either use:
# systemctl stop dhcpcd@wlan0 # systemctl start dhcpcd@wlan0 or # dhcpcd -k wlan0 # dhcpcd wlan0
To disconnect/connect I use poff/pon commands and the scripts are setup exactly as described on the Wiki.
So, you become root everytime you change network? If you need this kind of dynamic connectivity, you'll be much better off using networkmanager... -- Leonid Isaev GnuPG key: 0x164B5A6D Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
On Fri, 7 Dec 2012 12:41:56 -0600 Leonid Isaev <lisaev@umail.iu.edu> wrote:
Is this behavior normal or a bug?
I think it is normal.
This discussion may shed some light on the bad reasoning likely behind what you are experiencing as ipv6 overscoped on the back of one necessity. http://marc.info/?l=openbsd-misc&m=135110703125929&w=2
participants (5)
-
Kevin Chadwick
-
Leonid Isaev
-
Stefano Avallone
-
Sudaraka Wijesinghe
-
Δημήτρης Ζέρβας