LinuxQuestions.org
Help answer threads with 0 replies.
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 03-31-2003, 03:12 AM   #1
slacknut
LQ Newbie
 
Registered: Mar 2003
Posts: 4

Rep: Reputation: 0
IP Alias


Could someone point me in the right direction on how to have multiple ip # on a slackware box?

I have added this to rc.inet1.


Code:
/sbin/ifconfig eth0:1 XX.XX.XX.XX netmask 255.255.255.176 broadcast XX.XX.XX.XX
/sbin/route add -host XX.XX.XX.XX eth0:1
This is the error I get.

SIOCSIFADDR: No such device
SIOCSIFFLAGS: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
SIOCSIFFLAGS: No such device

Using 7.1 and do not see the ip_alias.o file like in older versions.
Is there a new way to do this that I have not found?
 
Old 03-31-2003, 07:05 AM   #2
Unseen
Member
 
Registered: Feb 2003
Distribution: debian
Posts: 56

Rep: Reputation: 15
Actually, I think your problem is the second line:

/sbin/route add -host XX.XX.XX.XX eth0:1

should be:
/sbin/route add -host XX.XX.XX.XX eth0.1

You are getting the error when using route, right?

Hope that helps.
 
Old 03-31-2003, 07:08 AM   #3
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
I have several machines that use multiple IP addresses. I normally do not need to add the route command at all. Usually though these are additional IP's on the existing network and no additional routing is required. Under 2.4 kernel when the IP is assigned it creates a routing entry for the subnet if required. They are also currently running 2.4 series kernel. If I recall Slack 7.1 was 2.2 kernel based. It might be required though for a 2.2 kernel, I do not remember. But it is easy enough to check after the the NIC is configured. (route -n)

I looked at the config for a 2.2.19 kernel source, probably from Slack 8.0, there was an option to enable IP: aliasing support. Also, 2.0 kernel has an option to enable Network Aliasing. So you probably want to check your kernel build options to see if it is enabled. When I enabled modules, the option would not allow for a module and the help did not state that a module was available or what the name would be. The option seems to have been removed in the 2.4 kernel.

From the error message reported, I am *assuming* that the initial config is working on the device eth0. I do not think the alias assignments have to be sequential on the assignment, unless it is required on the first alias. I noticed that you are using eth0:1 instead of eth0:0. If the device eth0 cannot be configured then you probably need to load the module support for the network adapter. I have always configured, eth0, eth0:0, eth0:1, etc. in that order.

Perhaps it will help.
 
Old 03-31-2003, 04:48 PM   #4
slacknut
LQ Newbie
 
Registered: Mar 2003
Posts: 4

Original Poster
Rep: Reputation: 0
I have 16 IP#'s that my ISP has assigned to me. 2 are being used on desktops, the others I have setup on three different servers. 2 with 1 IP each and the other is where I am trying to setup additional IP's on the machine. I am still stuck on this.

Thanks
 
Old 03-31-2003, 05:00 PM   #5
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
Is the first assignment on eth0 working OK? Is there an eth0:0 configured?
 
Old 03-31-2003, 05:11 PM   #6
slacknut
LQ Newbie
 
Registered: Mar 2003
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Excalibur
Is the first assignment on eth0 working OK? Is there an eth0:0 configured?
eth0 is working I can route to that IP.

If I try:
Code:
/sbin/ifconfig eth0:0 xx.xx.xx.167 netmask 255.255.255.176 broadcast xx.xx.xx.175
This is where I get the errors:

SIOCSIFADDR: No such device
SIOCSIFFLAGS: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
SIOCSIFFLAGS: No such device

Thanks
 
Old 03-31-2003, 07:36 PM   #7
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
If you are running a 2.2.x kernel then it looks like you will need to build a custom kernel to enable IP Aliasing. Since it looks you need to do a kernel build then perhaps consider the latest stable, 2.4.20 kernel.

Also, in regards to the numbers you posted. I think you are using the wrong subnet mask. I believe it should be 255.255.255.240. For a 16 IP subnet block assignment with a broadcast on .175 then the net assignment would be on .160 and the first usable IP address would be .161 and the last IP would be .174.

For a subnet assignment the 8 bit number would a sequence of one's starting with the most significant bit.

Bit = Subnet mask : size of subnet
1 = 128 : 128 IP subnet
1 = 192 : 64 IP subnet
1 = 224 : 32 IP subnet
1 = 240 : 16 IP subnet
1 = 248 : 8 IP subnet
1 = 252 : 4 IP subnet
1 = 254 : 2 IP subnet
1 = 255 : single IP address

A value of 176 would leave a zero in the 7th significant bit. ( 10110000 ) I would think this would be an illegal subnet assignment. It should be 11110000 or a decimal value of 240. Or another way to consider the subnet assignment value; 128 + 64 + 32 + 16 = 240.
 
Old 03-31-2003, 08:37 PM   #8
slacknut
LQ Newbie
 
Registered: Mar 2003
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Excalibur
If you are running a 2.2.x kernel then it looks like you will need to build a custom kernel to enable IP Aliasing.........

Also, in regards to the numbers you posted. I think you are using the wrong subnet mask. I believe it should be 255.255.255.240.

Excalibur,
How would I enable IP Aliasing when I rebuild a kernal? I am downloading the latest 2.4.20 source now.

Also I changed the netwmask to 255.255.255.240. then original was set to this but I changed it for some odd reason I do not remember.

Thanks for you help
 
Old 03-31-2003, 09:12 PM   #9
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
From what I can deternine you only need to enable TCP/IP protocol for the support. I am not able to locate any specific option for IP Aliases in the 2.4.x kernel. Now, I have the TCP/IP enabled with IP Mulitcasting, IP Advanced router, and IP Policy routing enabled. But none these options mention the alias support. Now my kernel also has Packet socket, packet filtering, socket filtering, Unix Domain Sockets, and a lot of stuff under Netfilter options. It is firewall, Masq, gateway server as well as a hosting server.

Since there are so many options to compiling a new kernel when you really do not have a starting config file. I may suggest two choices. If you want a modules based kernel then use a config file of your choice from the Slack 9 distro. It is 2.4.20 based. If you want a module disabled starting point and the options that I have, then send me an email through my profile and I will attach a config and return it to you. I don't mind using modules on workstations that are generally behind firewalls, but I do not like modules on production servers. I prefer to fully integrate all drivers and support into the kernel whenever possible.

Let me know if I can help in any other way.
 
Old 03-31-2003, 09:21 PM   #10
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
Also, something else that you may or may not have a problem with. I think it was around Slack 8.0 that the firewall support changed from ipchains to iptables. If you are using ipchains currently for filtering, then be carefull not to disable it in the 2.4.20 kernel. Your older Slack version does not have iptables installed and it would require a complete rewrite of the firewall rules to switch to iptables.
 
  


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
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM
ip alias mindcry Linux - Networking 0 10-16-2003 07:41 PM
using alias intruptz Linux - General 5 09-17-2003 04:32 AM
alias booyah Slackware 3 05-06-2003 03:17 PM
alias nobu Slackware 5 01-11-2003 01:09 PM

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

All times are GMT -5. The time now is 03:11 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