SlackwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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].
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 :-)
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 (?)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.