You are not logged in.

#1 2012-04-24 08:00:08

xintron
Member
From: Sweden
Registered: 2008-09-25
Posts: 32
Website

Multiple IP-addresses from DHCP

I've just bought a second NIC to my server to turn it in to a home-network router. My ISP offers 5 external IP-addresses and I would like my server to allocate these five. My current setup is as follows: I've created a bridge to eth0 (br0) which is used for my virtual servers running on the router. These connects to the bridge with their own tap-interface. A DHCP-server is running on eth1 for my LAN.

Currently my LAN is using the IP-address on br0 which is requested from my ISP's DHCP-server. Now I would like to create one more virtual interface, requesting IP from my ISP's DHCP-server, so that I then can NAT to one of my machines on the LAN. I've been searching and trying different setups but all without success. How should I go about and try to solve this?

Offline

#2 2012-04-24 11:51:04

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Multiple IP-addresses from DHCP

You should be able to do this by creating a vlan interface (bound to your existing eth0) and simply doing a dhcp request using that interface.

See this article for the exact configuration procedure.


Burninate!

Offline

#3 2012-04-24 11:58:09

xintron
Member
From: Sweden
Registered: 2008-09-25
Posts: 32
Website

Re: Multiple IP-addresses from DHCP

I've tried this with a vlan interface (linking it to eth0) and trying to use dhcpcd to request an IP-address but I don't get a lease like 90% of the times. I have no idea why this is and it seems very weird that only a few times I'll get a lease from the DHCP-server. I've also tried spoofing the MAC-address when requesting using dhcpcd but that hasn't worked that well either. Might it be something my ISP is doing so that they only try to give out one IP / NIC (with or without spoofed MAC)?

Offline

#4 2012-04-24 12:25:00

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Multiple IP-addresses from DHCP

Both interfaces (eth0 and your newly created vlan interface) will need to have a different mac address. The dhcp server will do its assignments based on mac address and you'll run into issues when duplicate mac's are on the same network (there are exceptions to this, but not going to bore you with that).

The fact that it sometimes works is already a start. Perhaps try running a capture when doing the dhcp request and see what's happening exactly when it fails. Possibly also try setting the DHCP_TIMEOUT value in your related netcfg profile (perhaps it's simply timing out).


Burninate!

Offline

#5 2012-04-24 16:10:59

xintron
Member
From: Sweden
Registered: 2008-09-25
Posts: 32
Website

Re: Multiple IP-addresses from DHCP

I've changed the mac address as well as the hostname (spoofed one just to be sure) but still no response. Did setup tcpdump to capture the data for the DHCP-request but there's no response from my ISP's router to my requests. Might their DHCP-server take some other data into consideration and just ignoring my requests (except MAC and hostname)?

Offline

Board footer

Powered by FluxBB