2 gatways in same network, one single DHCP! [INACTIVE]

BrazilFW 2.xhelp discussions in English.

2 gatways in same network, one single DHCP!

Mensagempor Wilfull » Ter Mar 17, 2009 6:18 am

Hi! I have a problem and i need some help! I wanna put 2 gateway on same network to divide the end-users in 2. So lets say i wanna 50% of the end-users to go on gatway A and others on gateway B. Like this i can improve the speed. I am avoiding to use load blance because i cant limit the upload on second NIC, so i was thinking to use 2 gateways!

The problems come on DHCP server. I cant use 2 DHCP servers because it might cause confilic, and have the error " Limited or not connectivity" . So my question is, how do i make DHC to give different gateways depends on the MAC request.

EX: I want MAC 00:00:00:00:00:01 to have next configutation

Ip 192.168.1.2
Subnet 255.255.255.0
gateway: 192.168.1

and 00:00:00:00:00:02

Ip 192.168.1.3
subnet 255.255.255.0
gateway 192.168.1.254


So i want a single DHCP server on the network, but that gives specific gateway, that i was setting up!
Wilfull
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Iulian » Ter Mar 17, 2009 6:35 am

Hello,
Your subnets are wrong, because you can't have 2 gateways for the same network. Try with 2 networks with 25 subnet mask!
Iulian
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Wilfull » Ter Mar 17, 2009 6:39 am

Iulian escreveu:Hello,
Your subnets are wrong, because you can't have 2 gateways for the same network. Try with 2 networks with 25 subnet mask!


Ok i got it. But how i am going to use one single DHCP?
Wilfull
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Iulian » Ter Mar 17, 2009 8:00 am

So, my proposal is to make 2 networks, as follows:

Subnet 1 (LAN 1): 192.168.1.0/24
Subnet 2 (LAN 2 - if you using different network card or LAN 1 for the same network card): 192.168.2.0/24

with the following settings:

/etc/coyote/subnet.cfg
Código: Selecionar todos
#subnet Active Subnet ID IP_Address Netmask Use_DHCP Use_QOS Download_Rate Download_Ceil Upload_Rate Upload_Ceil LAN LAN_ID CONN_LIMIT # Comments
subnet y 1 192.168.1.1 24 y y 512 512 256 256 LAN1 1 30 # Subnet 1
subnet y 2 192.168.2.1 24 y y 512 512 256 256 LAN2 2 30 # Subnet 2

/etc/dnsmasq.conf.template
Código: Selecionar todos
#dhcp-range=Starting IP Address,Ending IP Address,Lease Time
dhcp-range=192.168.1.2,192.168.1.254,12h
dhcp-range=192.168.2.2,192.168.2.254,12h

/etc/dhcp.reservation
Código: Selecionar todos
#dhcp-host=mac,IP address,Lease Time # Comments
dhcp-host=00:00:00:00:00:01,192.168.1.x,12h # PC in Subnet 1
dhcp-host=00:00:00:00:00:02,192.168.2.x,12h # PC in Subnet 2

Backup
Reload Subnet - /etc/rc.d/rc.subnet reload
Reload DHCP - /etc/rc.d/rc.dnsmasq reload

Good luck!
Iulian
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor yeager » Qua Mar 18, 2009 5:07 am

Iulian escreveu:Hello,
Your subnets are wrong, because you can't have 2 gateways for the same network. Try with 2 networks with 25 subnet mask!

Why can i not have 2 gateways on a same network? I have it and work without problem. The only one problem is, that dhcp server can not assign gw for PCs and i must it set manualy.
yeager
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Iulian » Qua Mar 18, 2009 6:00 am

A gateway is a network point that acts as an entrance to another network. Therefore, a gateway is a router and you can not have 2 routers with the same class IP.
Do not confuse gateway with any server (web, ftp, etc.) placed in the same class IP.
For example:
Network 192.168.0.1/24
Subnet ID is 192.168.0.0
Broadcast Address is 192.168.0.255
Gateway address is an IP address from the range 192.168.0.1-192.168.0.254, usually 192.168.0.1 or 192.168.0.254.
After it is established, Broadcast Address will take requests from the network and sends it to a single gateway. If you have 2 gateways, to which will send?

But, why you need 2 gateways?
Iulian
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Iulian » Qua Mar 18, 2009 6:03 am

yeager escreveu:The only one problem is, that dhcp server can not assign gw for PCs and i must it set manualy.

What configuration have you for dhcp server?
Iulian
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor yeager » Qua Mar 18, 2009 12:14 pm

my first gw is 192.168.1.19 and second 192.168.1.190. DHCP run only on gw 190. i dont use extra settinds for DHCP, dont know what do you mean.
yeager
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Iulian » Qua Mar 18, 2009 2:09 pm

So, try this:

/etc/dnsmasq.conf.template
Código: Selecionar todos
#for the first gateway - 192.168.0.10:
dhcp-option=option:router,192.168.0.10
dhcp-range=192.168.0.11,192.168.0.20,255.255.255.0,192.168.0.10,12h
#for the second gateway - 192.168.0.30:
dhcp-option=option:router,192.168.0.30
dhcp-range=192.168.0.31,192.168.0.40,255.255.255.0,192.168.0.30,12h

/etc/dhcp.reservation
Código: Selecionar todos
#for a pc with first gateway:
dhcp-host=00:00:00:00:00:01,192.168.0.15,12h
#for a pc with second gateway:
dhcp-host=00:00:00:00:00:02,192.168.0.35,12h
Iulian
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor yeager » Qua Mar 18, 2009 5:02 pm

nice idea :)
yeager
 

Re: 2 gatways in same network, one single DHCP!

Mensagempor Wilfull » Dom Mar 22, 2009 11:29 am

Sry for been absent, but went from my city for a while, and no internet conection :(. I will try next week your code iulian! Like this will be much better then a load blance, cause' i can control the upload, and means a lot!

Thx again!
Wilfull
 


Voltar para BrazilFW 2.x - English Forum

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 2 visitantes