Page 1 of 1

Create 2 subnetworks

Posted: Sun Jan 21, 2024 6:21 am
by nathan974
hello currently under gargoyle x86 1.14 I have 2 bridge connection interfaces but I would like to segment my network into 2 different subnetworks:
eth0 = wan ip of my router in 192.168.1.10
eth1 = lan1 in 10.0.0.1
eth2 = lan2 in 10.0.1.1

The problem is that when I do it it works for eth2 but eth1 loses the connection.
what should I do to make it work?
Thanks in advance .

Re: Create 2 subnetworks

Posted: Sun Jan 21, 2024 7:27 am
by Lantis
Well what have you tried? Can you share the config changes you've made?

You will need to make the following changes:
- Network
- Establish a bridge device "brlan2_dev", including the eth devices you want. Remove it from the regular brlan_dev
- Establish a new interface 'lan2' which uses br-lan2 as the device
- Set the appropriate ipaddr

- DHCP
- Establish a new dhcp stanza for 'lan2' (it can probably be a direct copy of 'lan', with the interface referencing 'lan2'

- Firewall
- If you want lan2 and lan to communicate with each other, add lan2 to the existing 'lan' zone (via list network). Otherwise set up a new zone for lan2
- Set up a forwarding config between lan2 and wan


That's the basics, i might have missed something but that's a start.

Re: Create 2 subnetworks

Posted: Sun Jan 21, 2024 7:45 am
by nathan974
Hello Lantis
What I did looks like this but it doesn't work.

DHCP:
config dhcp 'lan' 'lan2'
option interface 'lan' 'lan2'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'


BRIDGE:
config device 'brlan2_dev'
option name 'br-lan2'
option type 'bridge'
list ports 'eth2'


INTERFACE:
config interface 'lan2'
option device 'br-lan2'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '10.0.1.1'
option ip6ifaceid '::1'
option dns '8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844'

FIREWALL:
config zone
option name 'lan2'
list network 'lan2'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'

config forwarding
option src 'lan2'
option dest 'wan'

Re: Create 2 subnetworks

Posted: Sun Jan 21, 2024 7:59 am
by nathan974
I am obliged to create a second bridge for it to work?? Can we do like in Debian??

Re: Create 2 subnetworks

Posted: Mon Jan 22, 2024 8:36 am
by Lantis
Yes you must create a second bridge.
Your DHCP config looks wrong.
Take a full copy of the default dhcp 'lan' stanza, paste it again and change it to refer to 'lan2' for the interface. It will also need another name for the second (lan2 will suffice).

Re: Create 2 subnetworks

Posted: Mon Jan 22, 2024 1:52 pm
by nathan974
ok thank,
I will try that and everything else is ok?

Re: Create 2 subnetworks

Posted: Tue Jan 23, 2024 4:57 am
by Lantis
It looked alright to me