LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-06-2022, 08:40 PM   #1
rwcooper
Member
 
Registered: Mar 2006
Posts: 123

Rep: Reputation: 20
[Solved] Gateway for wlan0?


If I do netstat -nr on one of my Rasberry Pi's I get:
Code:
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.32.12   0.0.0.0         UG        0 0          0 eth0
0.0.0.0         192.168.32.12   0.0.0.0         UG        0 0          0 wlan0
192.168.32.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.32.0    0.0.0.0         255.255.255.0   U         0 0          0 wlan0
On my Slackware computer I get:
Code:
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.32.12   0.0.0.0         UG        0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
192.168.32.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.32.0    0.0.0.0         255.255.255.0   U         0 0          0 wlan0
I want wlan0 on my Slackware computer to have an entry with a gateway of 192.168.32.12 just as on the Raspberry Pi, so that I can disconnect the ethernet cable for eth0 and ssh in using wlan0. I would appreciate any suggestions on how to to this. TIA...Randy

Last edited by rwcooper; 12-07-2022 at 12:11 PM.
 
Old 12-07-2022, 12:30 AM   #2
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 963

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
What your routing table looks like depends upon how you configured your network and these days there are different ways to do that.

The old way to configure your network is to edit /etc/rc.d/rc.inet1.conf
The new way to configure your network is to edit the filew which belongs to NetworkManager.

Then there is always the possibility to use your own custom scripts or other software like wicd.

But basically this is how things work:

You can have multiple interfaces connected to the same subnet, but the traffic out to that subnet from your machine will only go through one interface.

I don't know what would happen if you would configure your eth0 and wlan0 interface as a bridge and then assaign a single ip address to your bridge interface which might be named br0, maybe that would work for you. However, without knowing how your current configuration got its settings it will be hard to tell you what to try. Most likely you will end up with some custom scripts to configure your network.

regards Henrik

Last edited by henca; 12-07-2022 at 12:37 AM.
 
Old 12-07-2022, 12:15 PM   #3
rwcooper
Member
 
Registered: Mar 2006
Posts: 123

Original Poster
Rep: Reputation: 20
I was able to setup wifi on wlan0 using NetworkManager and it is working now. Thanks for your suggestion.
 
Old 12-08-2022, 01:55 PM   #4
chemfire
Member
 
Registered: Sep 2012
Posts: 422

Rep: Reputation: Disabled
its worth pointing out that having two interfaces on the same subnet but with different IPs does not give you 'roaming'. While new TCP connections would seamlessly start using the other adapter when one with the lower metric disconnects and its default route goes away, existing connections will still terminate as they are bound to a different socket/address.

Its also true you want to be careful about which interface has the lower metric. You could easily end up sending all or almost all your traffic out wlan0 even while eth0 is connected. Nothing like having a nice gigabit wired connection and using the 300mbs wlan without knowing when you decide to move that 300gig file off to the NAS..


People used to 'workaround' this issue with dummy adapter and enabling proxy arp, but that does not play nice with dhcp.. Although I suppose you could create an address reservation for whatever you assign to dummy and just let eth0 get a dynamic address as normal.

Network manager is probably the right approach for 2022 - but you might want the check out the route metrics and make sure outbound traffic is originating from the interface you think it is...
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
p2p-dev-wlan0 or wlan0 - what is the difference ? Jim232 Linux - Newbie 2 10-13-2018 01:45 PM
eth0 and wlan0 vs wlan0 problem player107 Linux - Wireless Networking 3 02-25-2013 09:54 AM
[SOLVED] wlan0 and wlan0:9 up, but nothing going through khym_chanur Linux - Wireless Networking 12 04-06-2012 11:53 PM
dhclient wlan0 - wlan0: not found nickleus Linux - Networking 1 05-10-2005 09:06 PM
Broadcom wireless with ndiswrapper: ifconfig wlan0 works; ifup wlan0 fails orangechicken Linux - Wireless Networking 2 04-17-2004 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration