Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-06-2007, 06:38 PM
|
#1
|
|
LQ Newbie
Registered: Aug 2007
Posts: 19
Rep:
|
One NIC, Two IP Addresses
Hi,
I need to assign two IP addresses to one NIC card. I found out about how to do it on Fedora/ RedHat, CentOS, but no luck with slackware.
All help is greatly appreciated, Thanks
|
|
|
|
08-06-2007, 07:40 PM
|
#2
|
|
Member
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816
Rep:
|
Hi, welcome to Slackware, the exciting distro where you do everything by hand
On this case for a secondary IP address for the same NIC it's just as easy as setting up another network interface, but with a little twist.
With ifconfig refer to the secondary IP with a :N suffix, there the N is some sort of numerical index, I'm not sure if there is a limit for more IP's. Here is an example that I have just tried on my machine
Code:
get yourself some root powers
:~$ su -
Password:
let's look at the device current setup...
root@zee:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:F2:18:B3:66
inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:538151 errors:0 dropped:0 overruns:0 frame:0
TX packets:516574 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:348025281 (331.9 MiB) TX bytes:254141627 (242.3 MiB)
Interrupt:18 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 b) TX bytes:100 (100.0 b)
this is the cool line
root@zee:~# ifconfig eth0:1 192.168.20.1 netmask 255.255.255.0 up
check again
root@zee:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:F2:18:B3:66
inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:539041 errors:0 dropped:0 overruns:0 frame:0
TX packets:517361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:348511684 (332.3 MiB) TX bytes:254587368 (242.7 MiB)
Interrupt:18 Base address:0x4000
eth0:1 Link encap:Ethernet HWaddr 00:15:F2:18:B3:66
inet addr:192.168.20.1 Bcast:192.168.20.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:18 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 b) TX bytes:100 (100.0 b)
now ... what if I don't want it anymore...
root@zee:~# ifconfig eth0:1 down
it's gone, just as expected :D
root@zee:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:F2:18:B3:66
inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:548612 errors:0 dropped:0 overruns:0 frame:0
TX packets:526503 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:354777456 (338.3 MiB) TX bytes:259399416 (247.3 MiB)
Interrupt:18 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 b) TX bytes:100 (100.0 b)
I hope this serves you as well.
Godspeed.
Last edited by raska; 08-06-2007 at 07:45 PM.
|
|
|
|
08-06-2007, 08:28 PM
|
#3
|
|
LQ Newbie
Registered: Feb 2007
Posts: 22
Rep:
|
Wireless
Would this same technique work for using the same wireless NIC on more than one network/SSID?
|
|
|
|
08-06-2007, 08:28 PM
|
#4
|
|
LQ Newbie
Registered: Aug 2007
Posts: 19
Original Poster
Rep:
|
One NIC, two IP
Awesome!!!
Thanks a million Raska. I did it and I was able to ping to it.
Again, Thanks!  )
Ray
|
|
|
|
08-07-2007, 06:20 AM
|
#5
|
|
Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,817
|
Quote:
|
Would this same technique work for using the same wireless NIC on more than one network/SSID?
|
No, that is a limitation of the wireless hardware.
Last edited by MS3FGX; 08-07-2007 at 08:42 AM.
|
|
|
|
08-07-2007, 07:37 AM
|
#6
|
|
LQ Newbie
Registered: Feb 2007
Posts: 22
Rep:
|
Wireless
MS3FGX, that doesn't quite make sense, if its a hardware limitation, why it possible to do that in windows using the same hardware?
|
|
|
|
08-07-2007, 07:42 AM
|
#7
|
|
Member
Registered: May 2004
Location: Lyon, France
Distribution: Slackware
Posts: 85
Rep:
|
Quote:
|
Originally Posted by Murkhadh
MS3FGX, that doesn't quite make sense, if its a hardware limitation, why it possible to do that in windows using the same hardware?
|
Probably because this is a proprietary feature of the driver or the utilities joined with the drivers. Anyway, I think this must be somewhat crappy for the bandwidth of your NIC is still the same and then, you divide an already low bandwidth by the number of wireless networks you connect.
|
|
|
|
08-07-2007, 08:08 AM
|
#8
|
|
Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,817
|
Quote:
|
if its a hardware limitation, why it possible to do that in windows using the same hardware?
|
Windows does not natively allow you to connect to multiple SSIDs at the same time. You can specify multiple SSIDs for it to chose from, and it will intelligently (I use the term lightly) determine which one to connect to based on various factors, but it cannot connect to them at the same time. This is, as I said earlier, a limitation of the physical hardware design. WiFi hardware was not designed to connect to multiple networks at once, largely because of how difficult that is to do with RF technology. Try and tune your car radio into two different stations at the same time, and you will get the idea.
The only way this is possible under Windows is using VirtualWiFi. This is not part of any mainline Windows release though, and is only a research project from Microsoft Research. It is still experimental software, but the benefit is that you can be "simultaneously" connected to multiple networks at once.
However, if you read their documentation, what is actually happening is that the driver virtualizes multiple interfaces that are configured independently as normal WiFi cards; the driver then rapidly switches between them so the process is transparent to the user. At no time is the card actually authenticated to more than one AP at a time, it just seems that way. If you really wanted to, you could do the same thing with a Bash script, though I don't know how well it would actually work; clearly there is some trickery going on with VirtualWiFi to minimize authentication times, buffer data, etc.
As Mark said, there may be cards that feature this as a proprietary feature (and as such then require proprietary drivers), but I have not personally ever heard of such cards existing, and it would definitely fall outside of the normal WiFi specs. Though on the other hand, this is not in itself an unusual situation; as 128 bit WEP is not part of the original WiFi specifications (due to laws limiting the cryptographic capability of exported devices), and was adopted later by hardware manufacturers independently (which is there is occasionally compatibility issues with 128 bit WEP between different brands of hardware).
|
|
|
|
08-07-2007, 08:19 AM
|
#9
|
|
LQ Newbie
Registered: Feb 2007
Posts: 22
Rep:
|
Whoa there
I never said at the same time.
I'm referring to something more like the "preferred Networks" order. Meaning windows goes down a list of "preferred" networks (SSID's) in order till it finds one.
The end goal is to not have to manually enter a SSID when i go from one familiar network to the next (home to work)
|
|
|
|
08-07-2007, 08:24 AM
|
#10
|
|
Member
Registered: May 2004
Location: Lyon, France
Distribution: Slackware
Posts: 85
Rep:
|
Aah, then it depends on the utility used to manage the Wifi connections. I think the ones included in KDE mimic the Windows utility so you can store profiles and switch between them at will (or maybe even automatically) but I'm not sure.
|
|
|
|
08-07-2007, 08:44 AM
|
#11
|
|
Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,817
|
Yes, in that case it is simply down to which WiFi manager software you are using. KDE has it's own (it has many, actually), GNOME has theirs, and then there are dozens of others ranging from GTK applications all the way to Bash/Perl scripts.
|
|
|
|
08-07-2007, 10:00 AM
|
#12
|
|
LQ Newbie
Registered: Feb 2007
Posts: 22
Rep:
|
ya i was looking for a way to do it from the command line.
|
|
|
|
08-07-2007, 10:02 AM
|
#13
|
|
Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,817
|
iwconfig does not have the capability to store and select between pre-configured networks, unfortunately. You need some middle-man application to do that for you, and then pass the information to iwconfig itself.
There are however applications like that which can do so on the command line. For example, WiFiRadar has a GTK interface but can also be told to automatically connect to the best network from the command line.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:58 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|