Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
hostapd with bridge
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Fri Feb 09, 2018 2:39 pm    Post subject: Reply with quote

I think you need to setup the dhcp server to listen on the LAN Interface then as well.

Greets, bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Rocky007
n00b
n00b


Joined: 22 Dec 2014
Posts: 66

PostPosted: Fri Feb 09, 2018 5:50 pm    Post subject: Reply with quote

I've got the following set: DHCPD_IFACE="brvlan1 brvlan2"

The Ethernet interface is vlaned and then bridged like in your config exact same way just other interface names

Code:

# WAN Interface
config_enp6s0="192.168.178.29/24"
routes_enp6s0="default via 192.168.178.1"
dns_servers_enp6s0="127.0.0.1 192.168.178.1"

# Bridge Interface
vlans_enp7s0="1 2"

config_enp7s0="null"
config_enp7s0_1="null"
config_enp7s0_2="null"

config_brvlan1="192.168.1.1/24"

config_brvlan2="192.168.2.1/24"

bridge_forward_delay_brvlan1=0
bridge_hello_time_brvlan1=1000
bridge_stp_state_brvlan1=1
bridge_brvlan1="enp7s0.1"

bridge_forward_delay_brvlan2=0
bridge_hello_time_brvlan2=1000
bridge_stp_state_brvlan2=1
bridge_brvlan2="enp7s0.2"

rc_net_brvlan1_need="net.enp7s0"
rc_net_brvlan2_need="net.enp7s0"

# WiFi Card Intern
modules_wlp9s0="!iwconfig !wpa_supplicant"
config_wlp9s0="null"

# WiFi Card Extern
modules_wlp10s0="!iwconfig !wpa_supplicant"
config_wlp10s0="null"

preup() {
        COUNTRY=DE crda
        rfkill unblock all
        iw reg set DE
}
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Sat Feb 10, 2018 12:52 pm    Post subject: Reply with quote

I thought the vlans are for wireless only. Do they connect to clients on ethernet as well?

greets, bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Rocky007
n00b
n00b


Joined: 22 Dec 2014
Posts: 66

PostPosted: Sat Feb 10, 2018 1:31 pm    Post subject: Reply with quote

Yes, that is what i want....

The server should give out ips via wireless net and ethernet (now 2 wireless cards, one for each subnet/vlan, and one ethernet interface vlaned to get this via ethernet too)
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Mon Feb 12, 2018 5:19 am    Post subject: Reply with quote

Hi,

im not running my dhcp directly on my hostapd server, but i have two subnet definitions in my dhcpd.conf on the other host. Since this has multiple network interfaces as well, it provided dhcp according to the subnets on the fitting interfaces without any issues. You should check your switch config as well, that the clients are on the same vlan on the switch which should get an ipaddress from the correspondent subnet definition.

if you have a cisco switch, the config for the interfaces should be something like this (iirc) if the first port is your hostapd server and the second port is a lan client and the vlan id is 3:

Code:

conf t
interface ethernet 0/1
switchport mode acccess
switchport access vlan 3
interface ethernet 0/2
switchport mode acccess
switchport access vlan 3
exit


dont forget to save the config, otherwise it will be gone on the next switch reboot ;)

greets, bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Rocky007
n00b
n00b


Joined: 22 Dec 2014
Posts: 66

PostPosted: Mon Feb 12, 2018 11:18 am    Post subject: Reply with quote

Hi,

i've got no manageable switch there.
Just a PowerLan Plug...

Maybe i don't need vlans?

Everithing i want to is:

- 2 WiFi Nets (1x Personal, 1x Guest)
- 2 Subnets in DHCP (1x Personal 192.168.1.0/24, 1x Guest 192.168.2.0/24)
- Everyone can connect to WiFi/LAN and on DHCP setting (allow/deny unknown-clients) it is in the specified subnet...
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Mon Feb 12, 2018 12:32 pm    Post subject: Reply with quote

You cant do vlans on the same switch if its not manageable and they make no sense, if you have two switches on different interfaces.

greets, bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Rocky007
n00b
n00b


Joined: 22 Dec 2014
Posts: 66

PostPosted: Mon Feb 12, 2018 1:11 pm    Post subject: Reply with quote

So I just need a bridge for what i want?

/etc/conf.d/net
Code:

# WAN Interface
config_enp6s0="192.168.178.29/24"
routes_enp6s0="default via 192.168.178.1"
dns_servers_enp6s0="127.0.0.1 192.168.178.1"

config_enp7s0="null"

config_br1="192.168.1.1/24"
bridge_forward_delay_br1=0
bridge_hello_time_br1=1000
bridge_stp_state_br1=0
bridge_br1="enp7s0.1"

config_br2="192.168.2.1/24"
bridge_forward_delay_br2=0
bridge_hello_time_br2=1000
bridge_stp_state_br2=0
bridge_br2="enp7s0.2"

rc_net_br1_need="net.enp7s0"
rc_net_br2_need="net.enp7s0"

# WiFi Card Intern
modules_wlp9s0="!iwconfig !wpa_supplicant"
config_wlp9s0="null"

# WiFi Card Extern
modules_wlp10s0="!iwconfig !wpa_supplicant"
config_wlp10s0="null"

preup() {
        COUNTRY=DE crda
        rfkill unblock all
        iw reg set DE
}



/etc/conf.d/dhcpd
Code:

DHCPD_IFACE="br1 br2"


/etc/conf.d/hostapd
Code:

INTERFACES="br1 br2 wlp9s0 wlp10s0"
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Tue Feb 13, 2018 5:53 am    Post subject: Reply with quote

Hi,

1st: you should install another ethernet card and a second wireless card if you want to isolate the networks, otherwise you wont be able to accomplish this.
2nd: create two bridges with either one ethernet and one wireless card
3rd: create the hostapd config according to your bridges.

or get a manageable switch and have a look at vlan howtos!

greets, bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Rocky007
n00b
n00b


Joined: 22 Dec 2014
Posts: 66

PostPosted: Tue Feb 13, 2018 11:13 am    Post subject: Reply with quote

Would it work to get a manged switch with vlan support and the powerlan to my room or do i need something between?
Maybe a powerlan with multiple ethernet ports?
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Tue Feb 13, 2018 11:56 am    Post subject: Reply with quote

Im not sure about vlan via powerlan, havent testet mine coz i want to replace it. Maybe a second powerlan with different encryption key can work with vlans but dont count on this. But there are some powerlan adapter, that support vlan. Just check yours for 802.1q support. If it supports this, you should be good.

greets, bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum