LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-12-2011, 06:53 AM   #1
diwljina
Member
 
Registered: Jun 2009
Distribution: Slackware, Debian
Posts: 111

Rep: Reputation: 8
VLAN configuring


Hi!

I was wondering what is the proper way to set up interface in Slackware to use VLANs. I do it by writing necessary commands in rc.local, but is there way to use inet1.conf?
 
Old 06-17-2011, 06:32 AM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Not sure.

Unfortunately, using this setting does not work :

# Config information for eth1:1:
IPADDR[1:1]="10.0.0.99"
NETMASK[1:1]=""
USE_DHCP[1:1]=""
DHCP_HOSTNAME[1:1]=""

Maybe someone will enhance this.
 
Old 06-17-2011, 07:17 AM   #3
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
The way linux.tar.gz tried does indeed not work: the part between the square brackets is parsed in a integer-increment loop.
I think the original script uses values 0-4, but I'm too lazy to check, you may have to increase the value, or use a [2] or [3] instead of where I used [5].

I think the below may work (not tested):
Code:
IFNAME[5]="eth1:1"
IPADDR[5]="10.0.0.99"
NETMASK[5]=""
USE_DHCP[5]=""
DHCP_HOSTNAME[5]=""
 
Old 06-17-2011, 07:39 AM   #4
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Well done, sir !

It works, although some errors (in french) i'm too lazy to translate ;^)
 
Old 06-17-2011, 08:01 AM   #5
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
probably the netmask, which was not set in the example configuration. But I am curious to the errors you get. The solution was done completely from the top of my head, coz I have never had to use this style :-)
 
Old 06-17-2011, 08:10 AM   #6
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
I put a 255.255.255.0 netmask.

Here i am :

USAGE: ipmask <decimal netmask> <decimal IP address>
netmask: Unknown host
 
Old 06-17-2011, 08:14 AM   #7
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Oop, made a mistake.

I don't understand why it worked, because it won't anymore :/

I got :
SIOCSIFNETMASK: Ne peut attribuer l'adresse demandée
"can't give wanted adress"
 
Old 06-17-2011, 09:02 AM   #8
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
Here's a snippet from /etc/rc.d/rc.inet1.conf I just created to try it out:
Code:
# Config information for eth0:
IPADDR[0]="192.168.2.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IFNAME[1]="eth0:1"
IPADDR[1]="192.168.3.1"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
If I run /etc/rc.d/rc.inet1 eth0_start and then /etc/rc.d/rc.inet1 eth0:1_start
and then check out ifconfig:
Code:
ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1f:d0:92:63:8d  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:27 Base address:0xa000 

eth0:1    Link encap:Ethernet  HWaddr 00:1f:d0:92:63:8d  
          inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:27 Base address:0xa000
you see it actually worked, so it should go fine; it may be that the base interface needs to have an address (?)
 
Old 06-17-2011, 02:15 PM   #9
diwljina
Member
 
Registered: Jun 2009
Distribution: Slackware, Debian
Posts: 111

Original Poster
Rep: Reputation: 8
Actually, that's aliases and it works that way, but vlans are something else. I guess that inet1 doesn't know how to work with them. It should first load 8021q module if there is some vlans in configuration (or let rc.modules to handle that); then add specified vlans to desired interface using vconfig; bring up interface; and last thing inet1 knows how to do - set IP address, netmask and default route. I'll just keep using rc.local for this, but it would be nice to have Slackware take care of it in it's own way properly.
 
Old 06-20-2011, 11:24 AM   #10
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Oops :^)

So you have to tweak other init files, which is, imho, not a good idea. rc.local is for custom configs, and it's exactly what you do.

If it works as is, use your time to do other things ^^.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Route non-vlan packet to a vlan interface mic.sed Linux - Networking 2 04-23-2010 02:39 AM
VLan help on Cisco 870 to Linux vlan spide21 Linux - Networking 4 07-30-2009 08:20 AM
DHCP Config for VLAN's using 1NIC and non VLAN router. scottgutman Linux - Networking 1 07-22-2009 01:41 AM
VLAN configuration - native VLAN and setting PVID kumarwaiting Linux - Networking 0 07-24-2006 02:51 AM
Vlan >G< Linux - Networking 3 06-29-2006 12:03 AM

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

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