[opensuse] What would be the proper command to swtich off wlan?
Hi, I have a small laptop that doesn't have a separate switch for the WiFi, and when I plug in the ethernet cable I get both wlan and eth connections, which cause some problems (it should not, but it does). The laptop has a "airplane button" on F7 special keys which is ignored. Other keys do work, like the volume. The command "rcnetwork stop wlan1" does stop wlan, but "rcnetwork restart eth0" starts again the wifi (both, eth and wlan). How can I stop the wlan, so that NM doesn't reactivate it again? -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 2018-08-24 10:30, Carlos E. R. wrote:
Hi,
Hi Carlos,
I have a small laptop that doesn't have a separate switch for the WiFi, and when I plug in the ethernet cable I get both wlan and eth connections, which cause some problems (it should not, but it does).
The laptop has a "airplane button" on F7 special keys which is ignored. Other keys do work, like the volume.
The command "rcnetwork stop wlan1" does stop wlan, but "rcnetwork restart eth0" starts again the wifi (both, eth and wlan).
How can I stop the wlan, so that NM doesn't reactivate it again?
I had similar problem a few years back at a conference. I'm not sure (can't remember exactly what I did) but I think I did like the manual said for nmcli. It stops wlan1 from auto-connecting. nmcli dev disconnect wlan1 Ref. man nmcli search for "nmcli dev disconnect em2" Cheers, -- /bengan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-24 11:17, Bengt Gördén wrote:
On 2018-08-24 10:30, Carlos E. R. wrote:
Hi,
Hi Carlos,
I have a small laptop that doesn't have a separate switch for the WiFi, and when I plug in the ethernet cable I get both wlan and eth connections, which cause some problems (it should not, but it does).
The laptop has a "airplane button" on F7 special keys which is ignored. Other keys do work, like the volume.
The command "rcnetwork stop wlan1" does stop wlan, but "rcnetwork restart eth0" starts again the wifi (both, eth and wlan).
How can I stop the wlan, so that NM doesn't reactivate it again?
I had similar problem a few years back at a conference. I'm not sure (can't remember exactly what I did) but I think I did like the manual said for nmcli. It stops wlan1 from auto-connecting.
nmcli dev disconnect wlan1
Ref. man nmcli search for "nmcli dev disconnect em2"
And to connect again? I fail to see "nmcli dev connect"? maybe this one: nmcli radio {all | wifi | wwan} [ARGUMENTS...] But: Legolas:~ # nmcli radio wifi Error: NetworkManager is not running. Legolas:~ # which is absurd. Ah. Legolas:~ # rcnetwork restart Legolas:~ # nmcli radio wifi enabled Legolas:~ # Legolas:~ # nmcli radio wifi off Legolas:~ # ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.127 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::f8a0:12a3:7a65:18ab prefixlen 64 scopeid 0x20<link> ether 1c:83:41:1b:d8:33 txqueuelen 1000 (Ethernet) RX packets 173191214 bytes 261212028115 (243.2 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 13363574 bytes 1741202542 (1.6 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 78023 bytes 528126292 (503.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 78023 bytes 528126292 (503.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Legolas:~ # nmcli radio wifi on Legolas:~ # ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.127 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::f8a0:12a3:7a65:18ab prefixlen 64 scopeid 0x20<link> ether 1c:83:41:1b:d8:33 txqueuelen 1000 (Ethernet) RX packets 173191243 bytes 261212030349 (243.2 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 13363589 bytes 1741205252 (1.6 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 78023 bytes 528126292 (503.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 78023 bytes 528126292 (503.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether ee:44:75:b6:4a:0a txqueuelen 1000 (Ethernet) RX packets 155634 bytes 10336397 (9.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4135 bytes 431016 (420.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Legolas:~ # This is good :-) Thanks for the hint! :-) -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 2018-08-24 11:33, Carlos E. R. wrote:
On 2018-08-24 11:17, Bengt Gördén wrote:
Legolas:~ # nmcli radio wifi off
This is good :-)
Thanks for the hint! :-)
It is still off after a reboot. Surprising, but good. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 08/24/2018 03:30 AM, Carlos E. R. wrote:
Hi,
I have a small laptop that doesn't have a separate switch for the WiFi, and when I plug in the ethernet cable I get both wlan and eth connections, which cause some problems (it should not, but it does).
The laptop has a "airplane button" on F7 special keys which is ignored. Other keys do work, like the volume.
The command "rcnetwork stop wlan1" does stop wlan, but "rcnetwork restart eth0" starts again the wifi (both, eth and wlan).
How can I stop the wlan, so that NM doesn't reactivate it again?
Ohh, this may be old, but I used to have a script that would let me switch from wired to wireless and vice versa. IIRC, the actual command to take wireless up/down was # /etc/sysconfig/network/ifcfg-wlan0 down # to take wireless down The same worked for ifcfg-eth0 as well. This is from years past. If this no longer works, you can always manually take the wireless interface down as you are doing after you bring the wired up, but using ifconfig, e.g. # ifconfig wlan0 down No guarantees. My scripts are on my 11.4 drive. This is from the notes I had. -- David C. Rankin, J.D.,P.E.
On 2018-08-24 11:29, David C. Rankin wrote:
On 08/24/2018 03:30 AM, Carlos E. R. wrote:
Hi,
I have a small laptop that doesn't have a separate switch for the WiFi, and when I plug in the ethernet cable I get both wlan and eth connections, which cause some problems (it should not, but it does).
The laptop has a "airplane button" on F7 special keys which is ignored. Other keys do work, like the volume.
The command "rcnetwork stop wlan1" does stop wlan, but "rcnetwork restart eth0" starts again the wifi (both, eth and wlan).
How can I stop the wlan, so that NM doesn't reactivate it again?
Ohh, this may be old, but I used to have a script that would let me switch from wired to wireless and vice versa. IIRC, the actual command to take wireless up/down was
# /etc/sysconfig/network/ifcfg-wlan0 down # to take wireless down
The same worked for ifcfg-eth0 as well. This is from years past. If this no longer works, you can always manually take the wireless interface down as you are doing after you bring the wired up, but using ifconfig, e.g.
# ifconfig wlan0 down
No guarantees. My scripts are on my 11.4 drive. This is from the notes I had.
I think those would not work with wicked or network manager - that machine is on leap 15 :-) I found the way, though: nmcli radio wifi off :-) -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
* Carlos E. R. <robin.listas@telefonica.net> [08-24-18 05:37]:
On 2018-08-24 11:29, David C. Rankin wrote:
On 08/24/2018 03:30 AM, Carlos E. R. wrote:
Hi,
I have a small laptop that doesn't have a separate switch for the WiFi, and when I plug in the ethernet cable I get both wlan and eth connections, which cause some problems (it should not, but it does).
The laptop has a "airplane button" on F7 special keys which is ignored. Other keys do work, like the volume.
The command "rcnetwork stop wlan1" does stop wlan, but "rcnetwork restart eth0" starts again the wifi (both, eth and wlan).
How can I stop the wlan, so that NM doesn't reactivate it again?
Ohh, this may be old, but I used to have a script that would let me switch from wired to wireless and vice versa. IIRC, the actual command to take wireless up/down was
# /etc/sysconfig/network/ifcfg-wlan0 down # to take wireless down
The same worked for ifcfg-eth0 as well. This is from years past. If this no longer works, you can always manually take the wireless interface down as you are doing after you bring the wired up, but using ifconfig, e.g.
# ifconfig wlan0 down
No guarantees. My scripts are on my 11.4 drive. This is from the notes I had.
I think those would not work with wicked or network manager - that machine is on leap 15 :-)
odd, works for me with wicked but on tw, and has for some years now. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Registered Linux User #207535 @ http://linuxcounter.net Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
David C. Rankin wrote:
Ohh, this may be old, but I used to have a script that would let me switch from wired to wireless and vice versa. IIRC, the actual command to take wireless up/down was
# /etc/sysconfig/network/ifcfg-wlan0 down # to take wireless down
a typo? That file is a config, not normally executable, and even if you do run it, it won't do anything. Did you mean "ifdown wlan0" ? -- Per Jessen, Zürich (19.9°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/24/2018 04:47 AM, Per Jessen wrote:
David C. Rankin wrote:
Ohh, this may be old, but I used to have a script that would let me switch from wired to wireless and vice versa. IIRC, the actual command to take wireless up/down was
# /etc/sysconfig/network/ifcfg-wlan0 down # to take wireless down
a typo? That file is a config, not normally executable, and even if you do run it, it won't do anything.
Did you mean "ifdown wlan0" ?
Most certainly. as mentioned in the reply, this was from memory and notes, the actual script is on my 11.4 drive (on the shelf :) -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/24/2018 04:30 AM, Carlos E. R. wrote:
How can I stop the wlan, so that NM doesn't reactivate it again?
In the network manager settings, on the General configuration tab, there's a check box to automatically connect when available. Why not turn that off and just click on the WiFi connection when needed? Also, what sort of problems are you having? WiFi has a higher metric than Ethernet, so it won't normally be used, when connected to the same network. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-24 16:34, James Knott wrote:
On 08/24/2018 04:30 AM, Carlos E. R. wrote:
How can I stop the wlan, so that NM doesn't reactivate it again?
In the network manager settings, on the General configuration tab, there's a check box to automatically connect when available. Why not turn that off and just click on the WiFi connection when needed?
It is handy when not at home. And at home, some days I use one or the other. Also, I was considering using it on a script.
Also, what sort of problems are you having? WiFi has a higher metric than Ethernet, so it won't normally be used, when connected to the same network.
See my nmb thread today, for instance. nmb did see both interfaces. Then, I have a nm triggered script that edits hosts file to add an entry there with the current (local network) IP. So, I get the file written first with the eth0 IP, then overwritten with the wlan0 ip - which is the wrong one when eth is active. When nm goes out, it writes: #nm-mine-placemarker 127.0.0.1 Legolas.valinor Legolas which now is not correct. So, just this instant I do: Legolas:~ # rcnetwork restart Legolas:~ # and hosts is automatically changed to: #nm-mine-placemarker 192.168.1.127 Legolas.valinor Legolas which is what I want there this moment :-) (I created that script with some help from here, IIRC) Now, you will ask: why do you do that? :-) Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally. Yes, before you ask, I use postfix on a laptop. Dovecot is also happy this way :-) (I have explained this more than once ;-) ) -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 08/24/2018 06:32 PM, Carlos E. R. wrote:
Also, what sort of problems are you having? WiFi has a higher metric than Ethernet, so it won't normally be used, when connected to the same network. See my nmb thread today, for instance. nmb did see both interfaces.
I wasn't following that thread. However, that shouldn't change the fact that the metric means that only the Ethernet connection is used when availalble and WiFi when it's not. Here's what mine shows:
ip route show default via 172.16.0.1 dev eth0 proto dhcp metric 100 default via 172.16.0.1 dev wlan0 proto dhcp metric 600 172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.42 metric 100 172.16.0.0/24 dev wlan0 proto kernel scope link src 172.16.0.40 metric 600
Because wlan0 has a higher metric, it will not be used when eth0 is available. If that's not working for you then you've got other problems.
Then, I have a nm triggered script that edits hosts file to add an entry there with the current (local network) IP. So, I get the file written first with the eth0 IP, then overwritten with the wlan0 ip - which is the wrong one when eth is active. When nm goes out, it writes:
Maybe the problem is with the script. Why is it writing both addresses, when using only Ethernet? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-25 03:09, James Knott wrote:
On 08/24/2018 06:32 PM, Carlos E. R. wrote:
Also, what sort of problems are you having? WiFi has a higher metric than Ethernet, so it won't normally be used, when connected to the same network. See my nmb thread today, for instance. nmb did see both interfaces.
I wasn't following that thread. However, that shouldn't change the fact that the metric means that only the Ethernet connection is used when availalble and WiFi when it's not. Here's what mine shows:
Well, nmb sees both, on another computer:
<3.3> 2018-08-24T09:28:18.327828+02:00 Isengard nmbd 1916 - - [2018/08/24 09:28:18.325062, 0] ../source3/nmbd/nmbd_namequery.c:109(query_name_response) <3.3> 2018-08-24T09:28:18.328270+02:00 Isengard nmbd 1916 - - query_name_response: Multiple (6) responses received for a query on subnet 192.168.1.16 for name VALINOR<1d>. <3.3> 2018-08-24T09:28:18.328682+02:00 Isengard nmbd 1916 - - This response was from IP 192.168.1.133, reporting an IP address of 192.168.1.133.
192.168.1.133 is the wlan, and I'm connected using eth on 192.168.1.127. Legolas:~ # ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.127 netmask 255.255.255.0 broadcast 192.168.1.255 ... wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.133 netmask 255.255.255.0 broadcast 192.168.1.255 After disabling wlan on Legolas, Isengard changed the report a bit:
<3.3> 2018-08-24T10:13:48.255147+02:00 Isengard nmbd 1916 - - [2018/08/24 10:13:48.254873, 0] ../source3/nmbd/nmbd_namequery.c:109(query_name_response) <3.3> 2018-08-24T10:13:48.256303+02:00 Isengard nmbd 1916 - - query_name_response: Multiple (2) responses received for a query on subnet 192.168.1.16 for name VALINOR<1d>. <3.3> 2018-08-24T10:13:48.256937+02:00 Isengard nmbd 1916 - - This response was from IP 192.168.1.127, reporting an IP address of 192.168.1.127.
"Multiple (2)" instead of 6. Improvement. Metrics notwithstanding, other computer's programs see both interfaces sometimes for reasons I don't understand.
Then, I have a nm triggered script that edits hosts file to add an entry there with the current (local network) IP. So, I get the file written first with the eth0 IP, then overwritten with the wlan0 ip - which is the wrong one when eth is active. When nm goes out, it writes:
Maybe the problem is with the script. Why is it writing both addresses, when using only Ethernet?
Because NM calls my script twice. There are two interfaces, thus one call per interface. It is not my script, it is NM. Yes, maybe I could improve my script to handle that double call, but so far I'm out of ideas for that. And I'm leaving on a trip, so I won't be doing that soon. For the moment, manually disabling radio solves the issue. Besides, it is possible that eventually I put both eth and wlan on the same exact IP, as I do on my other laptop. Why? Because that way "ssh Legolas" on other machines will work regardless of Legolas using cable or radio. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 08/25/2018 05:28 AM, Carlos E. R. wrote:
192.168.1.133 is the wlan, and I'm connected using eth on 192.168.1.127.
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-25 13:09, James Knott wrote:
On 08/25/2018 05:28 AM, Carlos E. R. wrote:
192.168.1.133 is the wlan, and I'm connected using eth on 192.168.1.127.
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to.
Sorry, I have no time to investigate it now, I'm going. The important thing is that the two interfaces are seen, even if one is handling almost all the traffic. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
Carlos E. R. wrote:
On 2018-08-25 13:09, James Knott wrote:
On 08/25/2018 05:28 AM, Carlos E. R. wrote:
192.168.1.133 is the wlan, and I'm connected using eth on 192.168.1.127.
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to.
Sorry, I have no time to investigate it now, I'm going. The important thing is that the two interfaces are seen, even if one is handling almost all the traffic.
Aren't we talkaing about broadcast traffic anyway? It'll go out over all interfaces, I would think. -- Per Jessen, Zürich (14.6°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/25/2018 09:07 AM, Per Jessen wrote:
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to. Sorry, I have no time to investigate it now, I'm going. The important thing is that the two interfaces are seen, even if one is handling almost all the traffic. Aren't we talkaing about broadcast traffic anyway? It'll go out over all interfaces, I would think. It's still IP and it follows the metric. When both Ethernet and WiFi are connected to the same network, Ethernet will be used because of the lower metric. Nothing should be going out of the WiFi.
Again, fire up Wireshark and see what happens. In my experiment, I had my notebook connected via both Ethernet and WiFi and tried pinging it from my desktop system. The ping requests would go to the appropriate interface, but responses always came back via Ethernet, even though they showed the WiFi IP address. Pinging the desktop always used the Ethernet port, not WiFi. Also, if Carlos is running a script on the notebook, he could always test for whether eth0 is up. Something like ip route show|grep eth0 will determine whether the Ethernet connection is up and respond appropriately. Regardless, I get the impression he's trying to fix the symptoms, rather than the root cause. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 08/25/2018 09:07 AM, Per Jessen wrote:
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to. Sorry, I have no time to investigate it now, I'm going. The important thing is that the two interfaces are seen, even if one is handling almost all the traffic. Aren't we talkaing about broadcast traffic anyway? It'll go out over all interfaces, I would think.
It's still IP and it follows the metric. When both Ethernet and WiFi are connected to the same network, Ethernet will be used because of the lower metric. Nothing should be going out of the WiFi.
It's a little hypothetical for me, but if I wrote an app to broadcast <something> I would default to using all available interfaces. Never mind any routing.
Again, fire up Wireshark and see what happens.
Yep, agree.
In my experiment, I had my notebook connected via both Ethernet and WiFi and tried pinging it from my desktop system. The ping requests would go to the appropriate interface, but responses always came back via Ethernet, even though they showed the WiFi IP address. Pinging the desktop always used the Ethernet port, not WiFi.
pinging isn't broadcast through. Or did you try that too? Ping the broadcast address of all available interfaces.
Regardless, I get the impression he's trying to fix the symptoms, rather than the root cause.
+1 -- Per Jessen, Zürich (13.7°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/25/2018 01:15 PM, Per Jessen wrote:
It's a little hypothetical for me, but if I wrote an app to broadcast <something> I would default to using all available interfaces. Never mind any routing.
Regardless, if the broadcasts are IP then they follow it IP rules. This includes the router function built into Linux. It looks at the interface metrics and sends it out via the lowest. Applications don't normally work directly with the interfaces. They provide the data and IP address and leave it to the OS to do the rest. The only non IP broadcasts you're likely to see these days are the ARP requests.
pinging isn't broadcast through. Or did you try that too? Ping the broadcast address of all available interfaces.
If there's no entry in the ARP cache for the destination, then a ping will trigger an ARP request. When you first ping an address, the computer has to use the subnet mask, to determine if the address is on the local LAN or not. If it is, then the MAC address has to be determined. I just ran a test, with both interfaces connected. I then pinged a non-existent IPv4 address, so as to generate a string of ARP requests. Wireshark, running on my desktop and filtering on Ethernet broadcasts, shows several ARP requests from the Ethernet port, but not WiFi. When I disconnect the Ethernet cable, the requests come from the WiFi address. At no time to I see ARP requests coming from both interfaces. So, even though ARP is not IP, Linux still determines the correct interface to use. I bet that if Carlos used Wireshark to watch the traffic, he wouldn't see it coming from WiFi, when Ethernet is connected. What his scripts do is another matter and I suspect that may be where the problem lies. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 08/25/2018 01:15 PM, Per Jessen wrote:
It's a little hypothetical for me, but if I wrote an app to broadcast <something> I would default to using all available interfaces. Never mind any routing.
Regardless, if the broadcasts are IP then they follow it IP rules. This includes the router function built into Linux. It looks at the interface metrics and sends it out via the lowest. Applications don't normally work directly with the interfaces. They provide the data and IP address and leave it to the OS to do the rest.
When it isn't configured, how does an application know which IP addresses to use? You do a getifaddrs() and get all interfaces and their broadcast addresses. There is little or no routing involved. -- Per Jessen, Zürich (12.9°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 04:19 AM, Per Jessen wrote:
Regardless, if the broadcasts are IP then they follow it IP rules. This includes the router function built into Linux. It looks at the interface metrics and sends it out via the lowest. Applications don't normally work directly with the interfaces. They provide the data and IP address and leave it to the OS to do the rest. When it isn't configured, how does an application know which IP addresses to use? You do a getifaddrs() and get all interfaces and their broadcast addresses. There is little or no routing involved.
I'm currently running a test. At the moment, both Ethernet & WiFi are connected and I'm watching for Ethernet broadcasts. I see the NetBIOS stuff from both IPs, but only the Ethernet MAC, when watching on the Ethernet port. I don't see anything on WiFi. When I disconnect the Ethernet cable, I only see it from the WiFi address on WiFi, as expected since the Ethernet port is down, with the cable disconnected. Bottom line, Linux manages to sort out the appropriate interface, even with things like NetBIOS broadcasts. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 08/26/2018 04:19 AM, Per Jessen wrote:
Regardless, if the broadcasts are IP then they follow it IP rules. This includes the router function built into Linux. It looks at the interface metrics and sends it out via the lowest. Applications don't normally work directly with the interfaces. They provide the data and IP address and leave it to the OS to do the rest. When it isn't configured, how does an application know which IP addresses to use? You do a getifaddrs() and get all interfaces and their broadcast addresses. There is little or no routing involved.
I'm currently running a test. At the moment, both Ethernet & WiFi are connected and I'm watching for Ethernet broadcasts. I see the NetBIOS stuff from both IPs, but only the Ethernet MAC, when watching on the Ethernet port. I don't see anything on WiFi.
Sorry, I had not taken into account that the interfaces would be on the same network. Then yes, routing metrics will take of outgoing messages. You will still _receive_ duplicate broadcasts though, from cupsd for instance. -- Per Jessen, Zürich (19.4°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 12:28 PM, Per Jessen wrote:
Sorry, I had not taken into account that the interfaces would be on the same network. Then yes, routing metrics will take of outgoing messages. You will still _receive_ duplicate broadcasts though, from cupsd for instance.
That was the start of this part of the thread, as Carlos was wanting to write a script to turn off WiFi, due to a problem he was experiencing. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 08/26/2018 12:28 PM, Per Jessen wrote:
Sorry, I had not taken into account that the interfaces would be on the same network. Then yes, routing metrics will take of outgoing messages. You will still _receive_ duplicate broadcasts though, from cupsd for instance.
That was the start of this part of the thread, as Carlos was wanting to write a script to turn off WiFi, due to a problem he was experiencing.
Yes, I realised that too late, hence my apology. -- Per Jessen, Zürich (19.2°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/25/2018 09:01 PM, James Knott wrote:
I bet that if Carlos used Wireshark to watch the traffic, he wouldn't see it coming from WiFi, when Ethernet is connected. What his scripts do is another matter and I suspect that may be where the problem lies.
You misunderstand what my script is and does. This script is "/etc/NetworkManager/dispatcher.d/mine", and is called directly by Network manager whenever any interface goes up or down. Metric does not matter here. Eth goes up, the script gets called by NM. Then wlan goes up, my script gets called again. Yes, I can modify my script to detect that eth is up when it gets called for wlan. That's a good idea. I will do it by writing a status flag, not by querying the network, though. Maybe I also need to worry about atomicity. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 05:08 AM, Carlos E. R. wrote:
You misunderstand what my script is and does.
This script is "/etc/NetworkManager/dispatcher.d/mine", and is called directly by Network manager whenever any interface goes up or down. Metric does not matter here. Eth goes up, the script gets called by NM. Then wlan goes up, my script gets called again.
No, I don't know what your script does, but it does appear to be causing the problem.
Yes, I can modify my script to detect that eth is up when it gets called for wlan. That's a good idea.
It might eliminate the problem with your script. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 08:42 AM, James Knott wrote:
You misunderstand what my script is and does.
This script is "/etc/NetworkManager/dispatcher.d/mine", and is called directly by Network manager whenever any interface goes up or down. Metric does not matter here. Eth goes up, the script gets called by NM. Then wlan goes up, my script gets called again. No, I don't know what your script does, but it does appear to be causing
On 08/26/2018 05:08 AM, Carlos E. R. wrote: the problem.
Yes, I can modify my script to detect that eth is up when it gets called for wlan. That's a good idea. It might eliminate the problem with your script.
A better command might be ip link show dev eth0|grep "state UP" as it doesn't seem to have the same delay in changing as ip route show does. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-26 08:42, James Knott wrote:
On 08/26/2018 05:08 AM, Carlos E. R. wrote:
You misunderstand what my script is and does.
This script is "/etc/NetworkManager/dispatcher.d/mine", and is called directly by Network manager whenever any interface goes up or down. Metric does not matter here. Eth goes up, the script gets called by NM. Then wlan goes up, my script gets called again.
No, I don't know what your script does, but it does appear to be causing the problem.
No, my script doesn't cause any problem. I detected what was going on because of my script, which I made to solve problems I was having, and that now I don't have. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2018-08-25 a las 12:51 -0400, James Knott escribió:
On 08/25/2018 09:07 AM, Per Jessen wrote:
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to. Sorry, I have no time to investigate it now, I'm going. The important thing is that the two interfaces are seen, even if one is handling almost all the traffic. Aren't we talkaing about broadcast traffic anyway? It'll go out over all interfaces, I would think. It's still IP and it follows the metric. When both Ethernet and WiFi are connected to the same network, Ethernet will be used because of the lower metric. Nothing should be going out of the WiFi.
Again, fire up Wireshark and see what happens.
Well, as I said, I can't. I'm not at that location for some time.
In my experiment, I had my notebook connected via both Ethernet and WiFi and tried pinging it from my desktop system. The ping requests would go to the appropriate interface, but responses always came back via Ethernet, even though they showed the WiFi IP address. Pinging the desktop always used the Ethernet port, not WiFi.
Also, if Carlos is running a script on the notebook, he could always test for whether eth0 is up. Something like ip route show|grep eth0 will determine whether the Ethernet connection is up and respond appropriately.
Well, that's an idea. I only found out the script was running twice recently.
Regardless, I get the impression he's trying to fix the symptoms, rather than the root cause.
And what would that be? I really do not want the radio to be on when not needed. What would you do when both eth and wlan are intentionally on the same IP? There is collission. Currently they are not, but eventually I will configure that way. - -- Cheers Carlos E. R. (from openSUSE 15.0 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCW4JnEhwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVXK4AnReqXeDnOSMHgwaBOL+N tFl+hCl6AJ9Xv8GEM+f7eeRmyRoUkiyT4Sh7cQ== =SYLG -----END PGP SIGNATURE-----
On 08/26/2018 04:38 AM, Carlos E. R. wrote:
What would you do when both eth and wlan are intentionally on the same IP? There is collission.
Why are they on the same IP? On my notebook, they have different IP addresses, as provided by the DHCP server. While I have the addresses tied to MACs, the DHCP server won't allow assigning the same address to 2 MACs. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-26 07:17, James Knott wrote:
On 08/26/2018 04:38 AM, Carlos E. R. wrote:
What would you do when both eth and wlan are intentionally on the same IP? There is collission.
Why are they on the same IP? On my notebook, they have different IP addresses, as provided by the DHCP server. While I have the addresses tied to MACs, the DHCP server won't allow assigning the same address to 2 MACs.
Intentionally, to be able to ssh-in to the same name and IP from other computers, not needing to remember/know which interface is the lappy using this time. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 04:19 PM, Carlos E. R. wrote:
Why are they on the same IP? On my notebook, they have different IP addresses, as provided by the DHCP server. While I have the addresses tied to MACs, the DHCP server won't allow assigning the same address to 2 MACs. Intentionally, to be able to ssh-in to the same name and IP from other computers, not needing to remember/know which interface is the lappy using this time.
Again, not necessary with Linux. Configure different addresses for Ethernet and WiFi, then work with the WiFi address, even when Ethernet is connected. That's all you need to do. Give it a try and see what happens. You're trying to solve a problem that doesn't exist. Also, by insisting on using the same address for both interfaces, you're ruling out using DHCP. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-30 16:29, James Knott wrote:
On 08/30/2018 04:19 PM, Carlos E. R. wrote:
Why are they on the same IP? On my notebook, they have different IP addresses, as provided by the DHCP server. While I have the addresses tied to MACs, the DHCP server won't allow assigning the same address to 2 MACs. Intentionally, to be able to ssh-in to the same name and IP from other computers, not needing to remember/know which interface is the lappy using this time.
Again, not necessary with Linux. Configure different addresses for Ethernet and WiFi, then work with the WiFi address, even when Ethernet is connected. That's all you need to do. Give it a try and see what happens. You're trying to solve a problem that doesn't exist.
Last time I tried, years ago, it did not work. I'll try your way when I get back home.
Also, by insisting on using the same address for both interfaces, you're ruling out using DHCP.
Not really, depends on the server you can actually do it. On others, have one interface on dhcp, the other on fixed. Anyway, I prefer fixed. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 04:36 PM, Carlos E. R. wrote:
Also, by insisting on using the same address for both interfaces, you're ruling out using DHCP. Not really, depends on the server you can actually do it.
What happens if both MAC addresses appear on the network? Which one gets the IP address? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-30 17:32, James Knott wrote:
On 08/30/2018 04:36 PM, Carlos E. R. wrote:
Also, by insisting on using the same address for both interfaces, you're ruling out using DHCP. Not really, depends on the server you can actually do it.
What happens if both MAC addresses appear on the network? Which one gets the IP address?
The one that is powered up :-) -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 06:55 PM, Carlos E. R. wrote:
What happens if both MAC addresses appear on the network? Which one gets the IP address? The one that is powered up :-)
And if both are? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-30 21:00, James Knott wrote:
On 08/30/2018 06:55 PM, Carlos E. R. wrote:
What happens if both MAC addresses appear on the network? Which one gets the IP address? The one that is powered up :-)
And if both are?
I switch one off, which is the original question :-) -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 04:19 PM, Carlos E. R. wrote:
Why are they on the same IP? On my notebook, they have different IP addresses, as provided by the DHCP server. While I have the addresses tied to MACs, the DHCP server won't allow assigning the same address to 2 MACs. Intentionally, to be able to ssh-in to the same name and IP from other computers, not needing to remember/know which interface is the lappy using this time.
I do that all the time, as I demonstrated in my previous note. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 26 Aug 2018 10:38:42 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
What would you do when both eth and wlan are intentionally on the same IP? There is collission. Currently they are not, but eventually I will configure that way.
Err, there's a pretty basic misunderstanding there, I think. IP addresses belong to interfaces. Each interface needs a distinct address. That is unless and until you start getting into clever high availability techniques and suchlike. Basically, if you have more than one interface with the same address, then only one of them can be online at any time. In normal circumstances, it is an error to configure an address collision. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 07:41 AM, Dave Howorth wrote:
Err, there's a pretty basic misunderstanding there, I think. IP addresses belong to interfaces. Each interface needs a distinct address. That is unless and until you start getting into clever high availability techniques and suchlike.
Basically, if you have more than one interface with the same address, then only one of them can be online at any time.
Actually, you can have multiple routers with the same IP, when used for load balancing. With it, there's one master router that handles ARP requests for the router IP and hands out different MAC addresses for each request. That way, if you have enough computers on the network, the load is approximately balanced over all the links. Also, token ring supported multiple computers with the same MAC addresses, for working with the IBM big iron. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 26 Aug 2018 08:49:50 -0400 James Knott <james.knott@jknott.net> wrote:
On 08/26/2018 07:41 AM, Dave Howorth wrote:
Err, there's a pretty basic misunderstanding there, I think. IP addresses belong to interfaces. Each interface needs a distinct address. That is unless and until you start getting into clever high availability techniques and suchlike.
Basically, if you have more than one interface with the same address, then only one of them can be online at any time.
Actually, you can have multiple routers with the same IP, when used for load balancing. With it, there's one master router that handles ARP requests for the router IP and hands out different MAC addresses for each request. That way, if you have enough computers on the network, the load is approximately balanced over all the links.
Also, token ring supported multiple computers with the same MAC addresses, for working with the IBM big iron.
That's just a longer way of saying what I already said. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-26 07:41, Dave Howorth wrote:
On Sun, 26 Aug 2018 10:38:42 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
What would you do when both eth and wlan are intentionally on the same IP? There is collission. Currently they are not, but eventually I will configure that way.
Err, there's a pretty basic misunderstanding there, I think. IP addresses belong to interfaces. Each interface needs a distinct address. That is unless and until you start getting into clever high availability techniques and suchlike.
Basically, if you have more than one interface with the same address, then only one of them can be online at any time.
Exactly, which is the main reason I wanted a command to switch off the wifi when cable gets connected, either automatically or manually. This tiny laptop needs the command because it doesn't have a wifi button.
In normal circumstances, it is an error to configure an address collision.
They don't collide if one is switched off :-) I program the same IP because I want to connect to this machine from others in the same network using the same name and IP, not having to consider whether this time I used the cable or the WiFi. I have been using that setup on my main laptop for years, and I will also use it on this tiny laptop at some point. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/29/2018 06:42 PM, Carlos E. R. wrote:
I program the same IP because I want to connect to this machine from others in the same network using the same name and IP, not having to consider whether this time I used the cable or the WiFi. I have been using that setup on my main laptop for years, and I will also use it on this tiny laptop at some point.
Linux already does that. If you connect to the WiFi address, you will still be able to do that, even when connected via Ethernet. My testing demonstrated that. This is one way Linux differs from Windows. As I mentioned, I can always connect to my WiFi, even if Ethernet is connected, as the built in routing handles that situation. Give it a try. Assign different addresses to WiFi and Ethernet. Connect with WiFi and verify you can ping it. Now, connect Ethernet and try pinging the WiFi address again. It will still work. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-29 21:00, James Knott wrote:
On 08/29/2018 06:42 PM, Carlos E. R. wrote:
I program the same IP because I want to connect to this machine from others in the same network using the same name and IP, not having to consider whether this time I used the cable or the WiFi. I have been using that setup on my main laptop for years, and I will also use it on this tiny laptop at some point.
Linux already does that. If you connect to the WiFi address, you will still be able to do that, even when connected via Ethernet. My testing demonstrated that. This is one way Linux differs from Windows. As I mentioned, I can always connect to my WiFi, even if Ethernet is connected, as the built in routing handles that situation. Give it a try. Assign different addresses to WiFi and Ethernet. Connect with WiFi and verify you can ping it. Now, connect Ethernet and try pinging the WiFi address again. It will still work.
Say: Wifi is on 192.168.1.10, and eth is on 192.168.1.11. On nameserver, Legolas=192.168.1.11 At desktop I type "ssh cer@legolas" and it works. Then I move the laptop to another room, and remove the cable. I do "ssh cer@legolas" and now doesn't work, because machine now is only 192.168.1.10. Nameserver does not change, hosts file do not change at all the machines. And no, I'm not going to type "ssh cer@legolas_e" or "ssh cer@legolas_w" Do you understand? I need both interfaces on 192.168.1.11 Yes, I know this can be handled with a central and dynamic DNS, but not going to do it. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 04:32 PM, Carlos E. R. wrote:
Then I move the laptop to another room, and remove the cable. I do "ssh cer@legolas" and now doesn't work, because machine now is only 192.168.1.10. Nameserver does not change, hosts file do not change at all the machines. And no, I'm not going to type "ssh cer@legolas_e" or "ssh cer@legolas_w"
Have you actually tried it? It works fine for me. My notebook computer has an address of 172.16.0.40 on WiFi and 172.16.0.42 on Ethernet. At the moment, it's connect via WiFi modem. If I ping 172.16.0.40, I get a response, but not if I ping 172.16.0.42. Now, when I plug in the Ethernet cable, both addresses work. I'll ssh to the WiFi address to see what the status is:
ip -4 route show default via 172.16.0.1 dev eth0 proto dhcp metric 100 default via 172.16.0.1 dev wlan0 proto dhcp metric 600 172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.42 metric 100 172.16.0.0/24 dev wlan0 proto kernel scope link src 172.16.0.40 metric 600
Now, I'll do the same with the Ethernet cable disconnected:
ip -4 route show default via 172.16.0.1 dev wlan0 proto dhcp metric 600 172.16.0.0/24 dev wlan0 proto kernel scope link src 172.16.0.40 metric 600
Notice that the Ethernet connection is now gone, but my ssh connection is still up. So, I am able to connect to the WiFi address, regardless of whether Ethernet is connected or not and connecting or disconnecting Ethernet has absolutely no effect on the ssh connection. As I said, you're trying to solve a problem that doesn't exist. This works, thanks to Linux doing proper routing, based on the metric. Now, as I suggested earlier, why don't you give this a try and prove it to yourself? BTW, in your example, you were trying to connect to the Ethernet address, which will fail when disconnected, as the interface drops and the address is no longer reachable. The WiFi address can be reached so long as WiFi is up, regardless of what's happening with the Ethernet connection. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-30 16:56, James Knott wrote:
On 08/30/2018 04:32 PM, Carlos E. R. wrote:
Then I move the laptop to another room, and remove the cable. I do "ssh cer@legolas" and now doesn't work, because machine now is only 192.168.1.10. Nameserver does not change, hosts file do not change at all the machines. And no, I'm not going to type "ssh cer@legolas_e" or "ssh cer@legolas_w"
Have you actually tried it? It works fine for me. My notebook computer has an address of 172.16.0.40 on WiFi and 172.16.0.42 on Ethernet.
Yes, I have. Years ago. ...
Now, as I suggested earlier, why don't you give this a try and prove it to yourself?
Because as I said before, I'm on a trip, not at home.
BTW, in your example, you were trying to connect to the Ethernet address, which will fail when disconnected, as the interface drops and the address is no longer reachable. The WiFi address can be reached so long as WiFi is up, regardless of what's happening with the Ethernet connection So, in your method, the WiFi has to always be powered and connected. Me,
I often switch it off when not needed. Saves battery. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 05:30 PM, Carlos E. R. wrote:
Have you actually tried it? It works fine for me. My notebook computer has an address of 172.16.0.40 on WiFi and 172.16.0.42 on Ethernet. Yes, I have. Years ago.
I can't speak to years ago, but it certainly works now. Also, as I mentioned, it works because Linux has routing built in. Even with routers from Cisco, you can specify which interface, a ping comes from, which means it may have to send it out another interface to reach the destination. As with Linux, but not Windows, it just works.
The WiFi address can be reached so long as WiFi is up, regardless of what's happening with the Ethernet connection So, in your method, the WiFi has to always be powered and connected. Me, I often switch it off when not needed. Saves battery.
So, why all this worrying about scripts? I leave my WiFi, both on the computer and access point, on all the time, so I can just use it without worrying. I normally connect the Ethernet only when I'm planning on doing major downloads, and then only to save time. Generally, I don't use the Ethernet connection at home. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-30 17:37, James Knott wrote:
On 08/30/2018 05:30 PM, Carlos E. R. wrote:
Have you actually tried it? It works fine for me. My notebook computer has an address of 172.16.0.40 on WiFi and 172.16.0.42 on Ethernet. Yes, I have. Years ago.
I can't speak to years ago, but it certainly works now. Also, as I mentioned, it works because Linux has routing built in. Even with routers from Cisco, you can specify which interface, a ping comes from, which means it may have to send it out another interface to reach the destination. As with Linux, but not Windows, it just works.
The WiFi address can be reached so long as WiFi is up, regardless of what's happening with the Ethernet connection So, in your method, the WiFi has to always be powered and connected. Me, I often switch it off when not needed. Saves battery.
So, why all this worrying about scripts?
The script is not affected by any of this. I still want the hosts file be correct when I'm in a different network.
I leave my WiFi, both on the computer and access point, on all the time, so I can just use it without worrying. I normally connect the Ethernet only when I'm planning on doing major downloads, and then only to save time. Generally, I don't use the Ethernet connection at home.
-- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 04:38 AM, Carlos E. R. wrote:
I really do not want the radio to be on when not needed.
Turning off automatic connection will do that. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-26 08:39, James Knott wrote:
On 08/26/2018 04:38 AM, Carlos E. R. wrote:
I really do not want the radio to be on when not needed.
Turning off automatic connection will do that.
That would be "permanent". I simply want the choice, the equivalent to a wifi button, that this lappy lacks. It would make me need mousing to connect every time. The command "nmcli radio wifi" is just perfect :-) -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/30/2018 04:40 PM, Carlos E. R. wrote:
Turning off automatic connection will do that. That would be "permanent". I simply want the choice, the equivalent to a wifi button, that this lappy lacks.
It would make me need mousing to connect every time. The command "nmcli radio wifi" is just perfect :-)
I'm not sure if it's me or you, but one of us seems a bit thick lately. How is entering that command easier than clicking on the network manager and choosing what you want to connect to? Again, it's not necessary, provided you always try to connect to the WiFi address, whether Ethernet is connected or not. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-30 17:04, James Knott wrote:
On 08/30/2018 04:40 PM, Carlos E. R. wrote:
Turning off automatic connection will do that. That would be "permanent". I simply want the choice, the equivalent to a wifi button, that this lappy lacks.
It would make me need mousing to connect every time. The command "nmcli radio wifi" is just perfect :-)
I'm not sure if it's me or you, but one of us seems a bit thick lately. How is entering that command easier than clicking on the network manager and choosing what you want to connect to?
Yes, it is easier. I only have to retrieve a command from bash history. Besides, this command resists a reboot, so I only need to do it once till I need to change.
Again, it's not necessary, provided you always try to connect to the WiFi address, whether Ethernet is connected or not.
I'll test that when I can, thanks for the idea. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/25/2018 03:07 PM, Per Jessen wrote:
Carlos E. R. wrote:
On 2018-08-25 13:09, James Knott wrote:
On 08/25/2018 05:28 AM, Carlos E. R. wrote:
192.168.1.133 is the wlan, and I'm connected using eth on 192.168.1.127.
Fire up Wireshark and see what's actually happening. I have verified in experiment that the metric works, but also when something is sent to the wlan interface, it actually goes there, as expected, but the return traffic goes out on Ethernet. Again, this is expected, as Linux supports routing and is doing what it's supposed to.
Sorry, I have no time to investigate it now, I'm going. The important thing is that the two interfaces are seen, even if one is handling almost all the traffic.
Aren't we talkaing about broadcast traffic anyway? It'll go out over all interfaces, I would think.
If that nmb traffic is a broadcast, that would explain why it seen on wlan too. Yes. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 04:16 AM, Carlos E. R. wrote:
If that nmb traffic is a broadcast, that would explain why it seen on wlan too. Yes.
Not if it's over IP, as it most certainly is these days. Microsoft dropped support for NetBIOS/Ethernet with XP, IIRC. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. wrote:
Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally.
Do you have the bugzilla number handy? Wietse Wenema usually doesn't leave bugs in his software, he's very picky.
Yes, before you ask, I use postfix on a laptop.
Sure, it's installed by default, isn't it ? -- Per Jessen, Zürich (16.9°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-25 10:14, Per Jessen wrote:
Carlos E. R. wrote:
Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally.
Do you have the bugzilla number handy? Wietse Wenema usually doesn't leave bugs in his software, he's very picky.
Yes, before you ask, I use postfix on a laptop.
Sure, it's installed by default, isn't it ?
Yes, but most people don't use it, even less on a laptop. Most people use Thunderbird who talks directly to the ISP, bypassing the local postfix. Easy peasy. There are talks now and then of removing the MTA. Postfix needs to know which interface is the local network, and looks at /etc/hosts file. If it finds 127.0.0.2 Telcontar.valinor Telcontar or equivalent, there is a huge trouble: fatal: parameter inet_interfaces: no local interface found for 127.0.0.2 It wants: 192.168.1.14 Telcontar.valinor Telcontar As that IP changes in a (mobile) laptop, I have to adjust hosts file to reflect the current reality. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
Carlos E. R. wrote:
On 2018-08-25 10:14, Per Jessen wrote:
Carlos E. R. wrote:
Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally.
Do you have the bugzilla number handy? Wietse Wenema usually doesn't leave bugs in his software, he's very picky.
Yes, before you ask, I use postfix on a laptop.
Sure, it's installed by default, isn't it ?
Yes, but most people don't use it, even less on a laptop.
They may not know that they do, but many services and such (e.g. smartd, cron) that deliver mail to root. For that, typically the sendmail wrapper is used to drop a mail straight into the postfix queue.
There are talks now and then of removing the MTA.
Yep, and I have argued against it, an MTA is required.
Postfix needs to know which interface is the local network, and looks at /etc/hosts file. If it finds
127.0.0.2 Telcontar.valinor Telcontar
or equivalent, there is a huge trouble: fatal: parameter inet_interfaces: no local interface found for 127.0.0.2
I just added that line to /etc/hosts on my laptop config (leap423), and restarted postfix. No problems. (I think the postfix config is 99.9% vanilla).
It wants: 192.168.1.14 Telcontar.valinor Telcontar
As that IP changes in a (mobile) laptop, I have to adjust hosts file to reflect the current reality.
You must have an unusual setup - I never have to do anything like that (when I go traveling). -- Per Jessen, Zürich (17.0°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-25 12:53, Per Jessen wrote:
Carlos E. R. wrote:
On 2018-08-25 10:14, Per Jessen wrote:
Carlos E. R. wrote:
Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally.
Do you have the bugzilla number handy? Wietse Wenema usually doesn't leave bugs in his software, he's very picky.
Yes, before you ask, I use postfix on a laptop.
Sure, it's installed by default, isn't it ?
Yes, but most people don't use it, even less on a laptop.
They may not know that they do, but many services and such (e.g. smartd, cron) that deliver mail to root. For that, typically the sendmail wrapper is used to drop a mail straight into the postfix queue.
Absolutely, but that is local traffic, not internet traffic. I use it for internet.
There are talks now and then of removing the MTA.
Yep, and I have argued against it, an MTA is required.
Me too.
Postfix needs to know which interface is the local network, and looks at /etc/hosts file. If it finds
127.0.0.2 Telcontar.valinor Telcontar
or equivalent, there is a huge trouble: fatal: parameter inet_interfaces: no local interface found for 127.0.0.2
I just added that line to /etc/hosts on my laptop config (leap423), and restarted postfix. No problems. (I think the postfix config is 99.9% vanilla).
Maybe something was changed after I reported. I tried here on desktop machine, no trouble. Dunno. It was: <https://bugzilla.novell.com/show_bug.cgi?id=824141>
It wants: 192.168.1.14 Telcontar.valinor Telcontar
As that IP changes in a (mobile) laptop, I have to adjust hosts file to reflect the current reality.
You must have an unusual setup - I never have to do anything like that (when I go traveling).
And do you actually use postfix to send your email? Because that is unusual nowdays. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
Carlos E. R. wrote:
On 2018-08-25 12:53, Per Jessen wrote:
Carlos E. R. wrote:
On 2018-08-25 10:14, Per Jessen wrote:
Carlos E. R. wrote:
Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally.
Do you have the bugzilla number handy? Wietse Wenema usually doesn't leave bugs in his software, he's very picky.
Yes, before you ask, I use postfix on a laptop.
Sure, it's installed by default, isn't it ?
Yes, but most people don't use it, even less on a laptop.
They may not know that they do, but many services and such (e.g. smartd, cron) that deliver mail to root. For that, typically the sendmail wrapper is used to drop a mail straight into the postfix queue.
Absolutely, but that is local traffic, not internet traffic. I use it for internet.
Aha, that does make a difference.
It was:
Ah yes, I remember now. Does the problem persist with Leap15 ? IMO, Wietse is correct when he says 127.0.0.2 cannot be listed as an address when it does not exist. What's special about 127.0.0.2 ?
It wants: 192.168.1.14 Telcontar.valinor Telcontar
As that IP changes in a (mobile) laptop, I have to adjust hosts file to reflect the current reality.
You must have an unusual setup - I never have to do anything like that (when I go traveling).
And do you actually use postfix to send your email? Because that is unusual nowdays.
Not my personal email, just whatever the system generates. However, running a mailserver on a dynamic address should not be an issue, although it is unusual. Would inet_interfaces = all work for you, maybe? -- Per Jessen, Zürich (14.6°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/25/2018 06:17 PM, Per Jessen wrote:
Carlos E. R. wrote:
On 2018-08-25 12:53, Per Jessen wrote:
Carlos E. R. wrote:
On 2018-08-25 10:14, Per Jessen wrote:
Carlos E. R. wrote:
Well, because postfix demands the correct IP there, and baulks with "localhost 127.0.0.1. There is a bugzilla on that, no real solution from either suse or postfix people. Both do what they do intentionally.
Do you have the bugzilla number handy? Wietse Wenema usually doesn't leave bugs in his software, he's very picky.
Yes, before you ask, I use postfix on a laptop.
Sure, it's installed by default, isn't it ?
Yes, but most people don't use it, even less on a laptop.
They may not know that they do, but many services and such (e.g. smartd, cron) that deliver mail to root. For that, typically the sendmail wrapper is used to drop a mail straight into the postfix queue.
Absolutely, but that is local traffic, not internet traffic. I use it for internet.
Aha, that does make a difference.
Yep. Today, for instance, I'm at a different site and I'm sending this from Thunderbird using postfix as an intermediary. Oh, yes, it is a complication. The advantages are that Thunderbird can fire and forget, with a proper log, and that I learn. :-)
It was:
Ah yes, I remember now. Does the problem persist with Leap15 ? IMO, Wietse is correct when he says 127.0.0.2 cannot be listed as an address when it does not exist. What's special about 127.0.0.2 ?
AFAIK it can be any 127.* address. It was ...2 because YaST wrote that way. It was some time ago.
It wants: 192.168.1.14 Telcontar.valinor Telcontar
As that IP changes in a (mobile) laptop, I have to adjust hosts file to reflect the current reality.
You must have an unusual setup - I never have to do anything like that (when I go traveling).
And do you actually use postfix to send your email? Because that is unusual nowdays.
Not my personal email, just whatever the system generates. However, running a mailserver on a dynamic address should not be an issue, although it is unusual. Would inet_interfaces = all work for you, maybe?
That's what I have now in this laptop. As a test, I have left in hosts this: 127.0.0.2 minas-tirith.valinor minas-tirith #nm-mine-placemarker #192.168.1.13 Legolas.valinor Legolas and restarted postfix. Now I will try to send. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2018-08-26 a las 10:59 +0200, Carlos E. R. escribió:
Not my personal email, just whatever the system generates. However, running a mailserver on a dynamic address should not be an issue, although it is unusual. Would inet_interfaces = all work for you, maybe?
That's what I have now in this laptop.
As a test, I have left in hosts this: 127.0.0.2 minas-tirith.valinor minas-tirith
#nm-mine-placemarker #192.168.1.13 Legolas.valinor Legolas
and restarted postfix. Now I will try to send.
It obviously worked. Well, something changed somewhere, the problem has disapeared. I also have a note on my hosts file about leafnode requiring a proper name in hosts file, not "localhost". But I don't have it installed here (yet? ) - -- Cheers Carlos E. R. (from openSUSE 15.0 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCW4JtfRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVZ5wAn2Fjl+UO2cEl0aM31bWl oQunQFUbAJoCiPAY3wAPi6SpysU9BbzBSENPuQ== =kIRf -----END PGP SIGNATURE-----
Per Jessen wrote:
Carlos E. R. wrote:
[snip]
Postfix needs to know which interface is the local network, and looks at /etc/hosts file. If it finds
127.0.0.2 Telcontar.valinor Telcontar
or equivalent, there is a huge trouble: fatal: parameter inet_interfaces: no local interface found for 127.0.0.2
Ah, I remember, we've had this talk before, about the 127.0.0.2 and postfix. I can't remember the outcome, but it probably wasn't very useful. -- Per Jessen, Zürich (14.8°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2018-08-25 a las 14:45 +0200, Per Jessen escribió:
Per Jessen wrote:
Carlos E. R. wrote:
[snip]
Postfix needs to know which interface is the local network, and looks at /etc/hosts file. If it finds
127.0.0.2 Telcontar.valinor Telcontar
or equivalent, there is a huge trouble: fatal: parameter inet_interfaces: no local interface found for 127.0.0.2
Ah, I remember, we've had this talk before, about the 127.0.0.2 and postfix. I can't remember the outcome, but it probably wasn't very useful.
At the time, I removed the 127 entry and wrote the script to create an entry for the current local network entry. Now perhaps it is not needed, but as I have it... - -- Cheers Carlos E. R. (from openSUSE 15.0 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCW4JuIBwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVvzoAn0RBcNgQYjJiFxZrxEf3 9u5jmAnHAJ4qM/qD19eMqaMoNlXnE20leQKr3w== =hW4F -----END PGP SIGNATURE-----
participants (8)
-
Bengt Gördén
-
Carlos E. R.
-
Carlos E. R.
-
Dave Howorth
-
David C. Rankin
-
James Knott
-
Patrick Shanahan
-
Per Jessen