RED and GREEN on same NIC using VLAN?

General questions.
Post Reply
raffe
Posts: 5
Joined: August 20th, 2018, 8:40 am

RED and GREEN on same NIC using VLAN?

Post by raffe » August 20th, 2018, 8:59 am

Hi! I did'nt want to wake up this old thread up from a long sleep, viewtopic.php?f=27&t=7242 , so I will start a new one. I have a VivoPC VM62 https://www.asus.com/Mini-PCs/VivoPC_VM62/ and it has one NIC.

I have a USB NIC as green and all works well, but I would like to use the "real" NIC for both RED and GREEN. And VLANs seems to be the future ;)

I have been reading the old thread (and https://wiki.ipfire.org/optimization/vlan/start ) and it seems like I have two choices.
arjen wrote:
November 6th, 2014, 12:12 pm
fixed ???? (but working)
> vconfig add red0 666 (where 666 is vlan id )
> ifconfig red0.666 up
> vi /var/ipfire/ethernet/settings
(change RED_DEV=red0 to RED_DEV=red0.66 )
> /etc/init.d/network restart
up and running.
And do something similar with GREEN.

Or changing /var/ipfire/ethernet/vlans and /var/ipfire/ethernet/settings manually.
Maybe /var/ipfire/ethernet/vlans

Code: Select all

GREEN_PARENT_DEV=red0
GREEN_VLAN_ID=222
GREEN_MAC_ADDRESS=54:a0:50:d6:3f:53
RED_PARENT_DEV=red0
RED_VLAN_ID=666
RED_MAC_ADDRESS=54:a0:50:d6:3f:53
And /var/ipfire/ethernet/settings

Code: Select all

CONFIG_TYPE=1
GREEN_DEV=green0
GREEN_MACADDR=54:a0:50:d6:3f:52 (this is a FAKE MAC)
GREEN_DESCRIPTION='"vlan 222"'
GREEN_DRIVER=r8169
RED_DEV=redvlan0
RED_MACADDR=54:a0:50:d6:3f:51 (this is a FAKE MAC)
RED_DESCRIPTION='"vlan 666"'
RED_DRIVER=r8169
GREEN_ADDRESS=192.168.222.251
GREEN_NETMASK=255.255.255.0
GREEN_NETADDRESS=192.168.222.0
GREEN_BROADCAST=192.168.222.255
RED_DHCP_HOSTNAME=ipfire
RED_DHCP_FORCE_MTU=
RED_ADDRESS=0.0.0.0
RED_NETMASK=0.0.0.0
RED_TYPE=DHCP
RED_NETADDRESS=0.0.0.0
RED_BROADCAST=255.255.255.255
Today /var/ipfire/ethernet/settings is like this

Code: Select all

CONFIG_TYPE=1
GREEN_DEV=green0
GREEN_MACADDR=00:05:1b:c0:d3:bb
GREEN_DESCRIPTION='"usb: ASIX Electronics Corp. AX88179 Gigabit Ethernet"'
GREEN_DRIVER=ax88179_178a
RED_DEV=red0
RED_MACADDR=54:a0:50:d6:3f:53
RED_DESCRIPTION='"pci: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)"'
RED_DRIVER=r8169
GREEN_ADDRESS=192.168.222.251
GREEN_NETMASK=255.255.255.0
GREEN_NETADDRESS=192.168.222.0
GREEN_BROADCAST=192.168.222.255
RED_DHCP_HOSTNAME=ipfire
RED_DHCP_FORCE_MTU=
RED_ADDRESS=0.0.0.0
RED_NETMASK=0.0.0.0
RED_TYPE=DHCP
RED_NETADDRESS=0.0.0.0
RED_BROADCAST=255.255.255.255
Have any one of you done something similar? Any suggestions?

User avatar
binky
Posts: 6
Joined: May 14th, 2015, 1:18 pm

Re: RED and GREEN on same NIC using VLAN?

Post by binky » September 10th, 2018, 4:43 pm

I've been looking at an 8 year old post as that has helped me https://forum.ipfire.org/viewtopic.php?f=51&t=1835

It mentions using

Code: Select all

RED_DEV=green0
to map the device in use by RED to be the 'green0' device, so from this perhaps

Code: Select all

RED_DEV=green0.666
would be the setting you need in /var/ipfire/ethernet/settings and

Code: Select all

RED_PARENT_DEV=green0
in /var/ipfire/ethernet/vlans

I've not tried it as I'm presently only using VLANs for the kids because I'm learning how to setup VLANs so want to take things slowly or I'll have a broken network (only just got switches that support VLANs 8) )

I'm sure someone more knowledgable will be able to advise you :D
Image

raffe
Posts: 5
Joined: August 20th, 2018, 8:40 am

Re: RED and GREEN on same NIC using VLAN?

Post by raffe » September 20th, 2018, 12:42 pm

Thanks!

You are right, if green0 = USB and red0 = "real" NIC and I only want to use the "real" NIC, maybe it should be something like this in /var/ipfire/ethernet/vlans

Code: Select all

GREEN_PARENT_DEV=red0
GREEN_VLAN_ID=222
GREEN_MAC_ADDRESS=54:a0:50:d6:3f:53
RED_PARENT_DEV=red0
RED_VLAN_ID=666
RED_MAC_ADDRESS=54:a0:50:d6:3f:53
And /var/ipfire/ethernet/settings

Code: Select all

CONFIG_TYPE=1
GREEN_DEV=red0.222
GREEN_MACADDR=54:a0:50:d6:3f:52 (this is a FAKE MAC)
GREEN_DESCRIPTION='"vlan 222"'
GREEN_DRIVER=r8169
RED_DEV=red0.666
RED_MACADDR=54:a0:50:d6:3f:51 (this is a FAKE MAC)
RED_DESCRIPTION='"vlan 666"'
RED_DRIVER=r8169
Today /var/ipfire/ethernet/settings is like this

Code: Select all

CONFIG_TYPE=1
GREEN_DEV=green0
GREEN_MACADDR=00:05:1b:c0:d3:bb
GREEN_DESCRIPTION='"usb: ASIX Electronics Corp. AX88179 Gigabit Ethernet"'
GREEN_DRIVER=ax88179_178a
RED_DEV=red0
RED_MACADDR=54:a0:50:d6:3f:53
RED_DESCRIPTION='"pci: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)"'
RED_DRIVER=r8169
GREEN_ADDRESS=192.168.222.251
GREEN_NETMASK=255.255.255.0
GREEN_NETADDRESS=192.168.222.0
GREEN_BROADCAST=192.168.222.255
RED_DHCP_HOSTNAME=ipfire
RED_DHCP_FORCE_MTU=
RED_ADDRESS=0.0.0.0
RED_NETMASK=0.0.0.0
RED_TYPE=DHCP
RED_NETADDRESS=0.0.0.0
RED_BROADCAST=255.255.255.255

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 8 guests