Segregate one VLAN from rest of network

When you are installing then you only ever get asked to enter the dynamic dhcp address range for Green. It is never asked for Blue.

The aim is that this gives you access for a computer on Green to open up the WUI. Then from their you can set up the dhcp settings for both Green and Blue, if present.

I have never tried what you are trying and don’t know if it should work the way you are finding or not.

I will try it out on my vm testbed system but that will have to wait for some other evaluations that are ongoing currently. Will get back once I have been able to test it out.

1 Like

I have entries for green0 and red0, but nothing mentioning blue (because I chose Ignore and didn’t assign anything to that zone?).

In the WUI, setting the Blue zone to VLAN on the Green NIC doesn’t seem to change that.

Try “Default” instead of “Bridge” for the blue zone.

Also maybe you should post the content of these two files (hide the sensitive info, including the mac address).

/var/ipfire/ethernet/vlans 
/var/ipfire/ethernet/settings 
1 Like

Yep I did try setting to Default early on, I took the screenshot early on in the process.

Contents of /var/ipfire/ethernet/vlans (MACs covered):

GREEN_MAC_ADDRESS=
ORANGE_VLAN_ID=
RED_MAC_ADDRESS=
ORANGE_PARENT_DEV=
BLUE_VLAN_ID=2
RED_VLAN_ID=
ORANGE_MAC_ADDRESS=
GREEN_PARENT_DEV=
GREEN_VLAN_ID=
BLUE_PARENT_DEV=00:01:2e:xx:xx:xx
BLUE_MAC_ADDRESS=02:5b:8b:xx:xx:xx
RED_PARENT_DEV=

Contents of /var/ipfire/ethernet/settings:

CONFIG_TYPE=3
BLUE_SLAVES=
GREEN_ADDRESS=192.168.1.1
GREEN_NETMASK=255.255.255.0
BLUE_NETMASK=255.255.255.0
RED_NETADDRESS=0.0.0.0
GREEN_MODE=
GREEN_NETADDRESS=192.168.1.0
ORANGE_MODE=
BLUE_ADDRESS=192.168.2.1
RED_STP=
RED_DESCRIPTION='"pci: Intel Corporation Ethernet Connection I219-LM (rev 21)"'
ORANGE_MACADDR=
GREEN_STP=
RED_SLAVES=
ORANGE_STP=
GREEN_SLAVES=
RED_DEV=red0
BLUE_MODE=
BLUE_MACADDR=
RED_NETMASK=0.0.0.0
RED_DHCP_HOSTNAME=router
RED_ADDRESS=0.0.0.0
BLUE_NETADDRESS=192.168.2.0
RED_DHCP_FORCE_MTU=
RED_MODE=
GREEN_MACADDR=00:01:2e:xx:xx:xx
GREEN_DRIVER=r8169
DEFAULT_GATEWAY=0.0.0.0
ORANGE_SLAVES=
RED_TYPE=DHCP
GREEN_DESCRIPTION='"pci: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)"'
RED_MACADDR=00:01:2e:xx:xx:xx
BLUE_STP=
RED_DRIVER=e1000e
GREEN_DEV=green0

Strangely, that Blue MAC address doesn’t exist on the system at all and I certainly didn’t enter it, unless the system creates it as a placeholder or something?

[root@router ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether 00:01:2e:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 scope global green0
       valid_lft forever preferred_lft forever
3: red0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether 00:01:2e:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 24.1.xxx.xxx/22 brd 255.255.255.255 scope global dynamic noprefixroute red0
       valid_lft 250377sec preferred_lft 207177sec
4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc cake state DOWN group default qlen 1000
    link/ether 0c:54:15:xx:xx:xx brd ff:ff:ff:ff:ff:ff

No blue device created (BLUE_DEV=). Why? Maybe you should open a bug report.

I managed to get some time today to do an install of red green and blue on 2 nics on my vm testbed.

I was able to successfully end up with a green network and a blue vlan network on the same network interface and ended up with both red and green dhcp options.



Screenshot_2022-09-28_15-10-29

The process I used was as follows.

Set up a vm with 2 nics. Ran install from CU170 iso.

Selected red, green and blue network type.

Assigned green and red to the two interfaces, selected ignore for the fact that blue flagged as not being assigned.

System booted and I went into the WUI.

The dhcp page only had the green option.
On the Zone Configuration page I added the Blue zone as a VLAN with an VLAN ID and pressed save. It then said to reboot which I did.

Then I went into the console and ran setup again and this time when selecting blue it had an interface available, which is the blue0 on green0 vlan shown as blue0@green0 interface on the ip address show output.

Having selected blue to the new interface I then exited from setup and went back to the WUI and now on the dhcp page I had both green and blue dhcp options. I then added in the blue dynamic range and enabled it.

Then rebooted again just to be certain and everything stayed with green and blue on dhcp and zone configuration with green and blue on vlan and ip address show giving the same output.

7 Likes

Bridge or default?

this is possibly the crucial step that was missing by the OP,

This tutorial form @bonnietwin should be made in a wiki page, considering how many thread we get for VLAN configuration.

2 Likes

I set it to Default. See the zone configuration screenshot

My stupid brain sometimes ignore things that are gigantic. My apologies.

Don’t worry about it. I have done the same thing myself.
It’s better to ask than to miss something important.

1 Like

I would defintely second adding that to the wiki… I haven’t seen any mention of needing to go back into setup anywhere online.

However, in my screenshot above, I’m definitely not getting the blue0@green0 device after configuring the blue zone to vlan in the WUI, nor am I able to select it when re-running setup. The only difference is that I have a wlan0 device that I’m not using… Since I don’t need it I’ll try physically removing the device and see if that makes a difference, to eliminate any potential for a device detection bug involving it.

1 Like

After you selected blue to vlan did you press save. You need to press save and then you need to reboot before going into setup.

I was about to tell you that I did, but I rebooted just to make sure I had before, and the interface did show up after that. :slight_smile:

I’m still testing, but I do believe the worst is behind me now!

EDIT: And all is good! @bonnietwin 's post is the holy grail solution to zoned VLAN routing on IPFire!

  • At initial setup, set the Blue zone to None, and Ignore the warning about it.
  • In the WUI, set the Blue zone to Default, and VLAN, on the same NIC as your green network.
  • Reboot
  • Go back into setup in the console, and re-assign the Blue zone to the newly created hybrid interface (blue0@green0 in my case)
  • Back in the WUI, you’ll now have access to the Blue DHCP server, which you can configure as you see fit.

A HUGE thank you to everyone who helped with this!

***I definitely think we need to add this information to the various wikis; I had studied the documentation and forums quite a bit before asking and I for sure didn’t see any mention of having to go through an extra round of console setup in order to get a VLAN running along side a native NIC. This will be quite a boon to the many users who ask about VLAN setup in the forums.

3 Likes

@darkhand First, congratulations on your success. I commend the way you acted in troubleshooting your system. This thread is very important as it will help other users of IPFire to learn to use a feature that has a sizeable request level and is very poorly documented. For that you and @bonnietwin did a very good thing. If @jon agrees, I will write a new entry on the wiki condensing all the info that have emerged in this thread.

As a curiosity, can I ask if /var/ipfire/ethernet/settings now has an entry like BLUE_DEV=blue0@green0? Any other change in that file and in /var/ipfire/ethernet/vlans?

4 Likes

Thanks @cfusco !

I actually don’t see a reference to blue0@green0 in either of the files, only when I run ip a. Might there be another setting file? The strange Blue MAC address from before is still present however, probably a randomized virtual MAC.

The contents of my /var/ipfire/ethernet/settings file after everything:

BLUE_STP=
BLUE_NETADDRESS=192.168.2.0
RED_DHCP_FORCE_MTU=
GREEN_ADDRESS=192.168.1.1
GREEN_NETADDRESS=192.168.1.0
GREEN_MODE=
GREEN_DRIVER=r8169
ORANGE_SLAVES=
BLUE_SLAVES=
GREEN_MACADDR=00:01:2e:xx:xx:xx
GREEN_NETMASK=255.255.255.0
GREEN_STP=
RED_DHCP_HOSTNAME=router
RED_NETADDRESS=0.0.0.0
RED_DRIVER=e1000e
GREEN_SLAVES=
BLUE_MODE=
RED_DEV=red0
RED_DESCRIPTION='"pci: Intel Corporation Ethernet Connection I219-LM (rev 21)"'
GREEN_DEV=green0
BLUE_ADDRESS=192.168.2.1
RED_MODE=
GREEN_DESCRIPTION='"pci: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)"'
RED_NETMASK=0.0.0.0
ORANGE_MODE=
RED_MACADDR=00:01:2e:xx:xx:xx
DEFAULT_GATEWAY=0.0.0.0
RED_TYPE=DHCP
RED_ADDRESS=0.0.0.0
RED_STP=
ORANGE_MACADDR=
CONFIG_TYPE=3
BLUE_MACADDR=02:5b:8b:xx:xx:xx
BLUE_NETMASK=255.255.255.0
RED_SLAVES=
ORANGE_STP=
BLUE_DEV=blue0
BLUE_DESCRIPTION='"???: Unknown Network Interface (blue0)"'
BLUE_DRIVER='Unknown Network Interface (blue0)'

Contents of /var/ipfire/ethernet/vlans:

ORANGE_VLAN_ID=
RED_MAC_ADDRESS=
BLUE_MAC_ADDRESS=02:5b:8b:xx:xx:xx
GREEN_MAC_ADDRESS=
RED_VLAN_ID=
GREEN_PARENT_DEV=
RED_PARENT_DEV=
ORANGE_MAC_ADDRESS=
GREEN_VLAN_ID=
BLUE_VLAN_ID=2
ORANGE_PARENT_DEV=
BLUE_PARENT_DEV=00:01:2e:xx:xx:xx
[root@router ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether 00:01:2e:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 scope global green0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc cake state DOWN group default qlen 1000
    link/ether 0c:54:15:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: blue0@green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether 02:5b:8b:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 scope global blue0
       valid_lft forever preferred_lft forever
5: red0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether 00:01:2e:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 24.1.xxx.xxx/22 brd 255.255.255.255 scope global dynamic noprefixroute red0
       valid_lft 211128sec preferred_lft 167928sec
1 Like

yes. I agree.
:+1:

@jon Where this tutorial should go in the wiki?

How about under the Zone Config page:

https://wiki.ipfire.org/configuration/network/zoneconf/vlan2nic

Thank you for documenting this!

EDIT: and thank you for creating the fcron wiki page. looks good!

2 Likes

@jon I created the page with that link. However, right now it is orphaned. I am not sure where to link it. Can I have your opinion? Thank you Jon.

I added it above the spanning tree section:

1 Like