ISC-DHCP-SERVER configuration help!
Hi everyone I am a noob to Linux but have created a squid proxy server already but it is not working when I connect other computers to the router, so I am using instead a ISC-DHCP-SERVER in order to give other pc's internet. I am running Ubuntu 12.10 and I am trying to set up a ISC-DHCP-SERVER through "eth0" being the internet nic and "eth0" the router to give other pc's internet. I have read many forums online on how to do this but for some reason cannot get it working. My ifconfig is
PHP Code:
eth0 Link encap:Ethernet HWaddr 00:14:85:45:8f:62
inet addr:192.168.1.93 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2602:304:499b:5ea9:29ff:f662:61c9:fe9f/64 Scope:Global
inet6 addr: 2602:304:499b:5ea9:214:85ff:fe45:8f62/64 Scope:Global
inet6 addr: fe80::214:85ff:fe45:8f62/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11013 errors:0 dropped:0 overruns:0 frame:0
TX packets:7707 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10470262 (10.4 MB) TX bytes:853099 (853.0 KB)
eth1 Link encap:Ethernet HWaddr 00:50:fc:55:27:7a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth1:avahi Link encap:Ethernet HWaddr 00:50:fc:55:27:7a
inet addr:169.254.7.70 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:13698 errors:0 dropped:0 overruns:0 frame:0
TX packets:13698 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9921214 (9.9 MB) TX bytes:9921214 (9.9 MB)
Can someone please advise what I should do next? When I...
sudo service isc-dhcp-server stop
I get a unknown instance:
But when I start I get a start/running, process 5080
Please help...thank you all.
Re: ISC-DHCP-SERVER configuration help!
First of all, I think you should split the "job".
1. Are the clients receiving IPs or not? (probably not since the process doesn't seem to be running correctly). Check the IPs on the clients also with ifconfig (or ipconfig on windows).
2. If this squid machine is supposed to be a router also, you need to configure both eth0 and eth1 interfaces, one external and the other internal. From your ifconfig eth1 doesn't seem to be configured with any IP, public or private.
3. Also, for a machine to be a router it needs to have the ip_forward set to 1 in /etc/sysctil.conf. The line is commented by default so you need to remove the # at the start. The line is something like:
/net/ipv4/ip_forward=1
And you need at least one POSTROUTING rule in iptables so that it can act as a router. How you apply that rule will depend whether you are using a firewall on this machine or not. If not using a firewall, it's enough to edit /etc/rc.local and before the exit 0 add:
iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
where ethX is the external interface.
Re: ISC-DHCP-SERVER configuration help!
Hi Darko,
Thanks for the reply.
Well...
1. The clients are not recieving IP addresses yet because I have not been able to get the DHCP running therefore I have not connect any other pc's to the eth0.
2. Well the static eth0 I put in recently but when I had configured the proxy I had only the eth1 as a static and have toggled the eth1 with dhcp and static.
3. I have done this as well making eth0 as the external interface. I did allow the ip_forward and the iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
I am going to keep giving it a shot but this has seem to be a bit more challenging than expected.
Re: ISC-DHCP-SERVER configuration help!
What you did when you had only one interface is not very relevant. Since now you have two, I think it will work best if you dedicate one as external (towards your internet router, etc), and the other as internal (towards your LAN).
So, set them up with static IPs in different subnets (ranges).
What got me confused is in ifconfig in the eth1:avahi section you can see the IP like 169.254.x.x. Usualy that's an automatic IP when there is no other option available. Or you are using this IP on purpose?
On the dhcp side, post /etc/dhcp/dhcp.conf the configuration file.
Also, if I'm not mistaken, the daemon is still dhcpd so you can try:
sudo service dhcpd start/stop/restart
PS. Maybe this can help you:
http://askubuntu.com/questions/14012...-a-dhcp-server
Re: ISC-DHCP-SERVER configuration help!
I was actually confused with how the eth1:avahi came about. I do not recall setting that up or installing anything like that so I did not know how to approach it.
I am trying to dedicate eth1 as the internet routerto give clients their IP's with eth0 as the internal that provides the internet. I should put both in the interface with different subnet ranges? Can eth0 be 192.168.1.93 which is the address?
Thanks a bunch, again.
Re: ISC-DHCP-SERVER configuration help!
Yes, they can. So, you want eth0 to be 192.168.1.93 and 192.168.1.1 is the router that goes to the internet?
For eth1 lets select 10.10.10.1 for example, with netmask 255.255.255.0 which covers the whole 10.10.10.x range.
In that case /etc/network/interfaces would be like:
Code:
auto eth0
iface eth0 inet static
address 192.168.1.93
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4 (or you can use the ISP DNS servers instead)
auto eth1
iface eth1 inet static
address 10.10.10.1
netmask 255.255.255.0
That's it.
In the dhcp config you will have to tell it to use only eth1 to serve the dhcp clients. It's better not to send any dhcp traffic towards the internet router. :)
This is just an example. In the /etc/network/interfaces code I didn't mention the lo interface, leave it as default as it is. Only make changes to eth0 and eth1.
Re: ISC-DHCP-SERVER configuration help!
For some reason now I do not have any internet connection when I configured the interfaces to the way you advised. Although now when i do ifconfig i get...
Quote:
eth0 Link encap:Ethernet HWaddr 00:14:85:45:8f:62
inet addr:192.168.1.93 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2602:304:499b:5ea9:214:85ff:fe45:8f62/64 Scope:Global
inet6 addr: fe80::214:85ff:fe45:8f62/64 Scope:Link
inet6 addr: 2602:304:499b:5ea9:9c7e:357d:66af:16ed/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:750 errors:0 dropped:0 overruns:0 frame:0
TX packets:739 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:431123 (431.1 KB) TX bytes:146711 (146.7 KB)
eth1 Link encap:Ethernet HWaddr 00:50:fc:55:27:7a
inet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:330 errors:0 dropped:0 overruns:0 frame:0
TX packets:330 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:59872 (59.8 KB) TX bytes:59872 (59.8 KB)
I seem to get internet when I...
#auto eth0
#iface eth0 inet static
# address 192.168.1.93
# netmask 255.255.255.0
# gateway 192.168.1.1
# dns-nameservers 8.8.8.8 8.8.4.4
auto eth1
iface eth1 inet static
address 10.10.10.1
netmask 255.255.255.0
Where in the dhcp.conf do I tell it to use only eth1 to server the dhcp clients?
Re: ISC-DHCP-SERVER configuration help!
Well, you have to help us out. Is eth0 connected to the internet router or eth1? How you configure the interfaces will depend on which one you connect to the internet router and which one to the local LAN.
First of all, how do you plan the server to go out to the internet? What will you connect it to?
Re: ISC-DHCP-SERVER configuration help!
eth0 is connected to the internet router.
I plan for the server to go out to the internet through eth1. I plan on connecting it to a switch where I can then connect different clients to. I acutally got everything working with DHCP but when I connected another pc to eth1 it will show it is connected but without internet.
Re: ISC-DHCP-SERVER configuration help!
You are confusing me now. If eth0 is connected to the internet router how do you plan it to go out to the internet using eth1?
If you want the server itself to be a router and dhcp server for the clients on the LAN, it should be the device between the internet router and the local LAN. Other machines on the LAN should have no physical access to the internet and the router, only through this server machine.
Otherwise, if clients can reach and use the internet router, you don't need this server to route them.
I think you have it connected wrongly, that's why the clients didn't have internet. Otherwise, if the routing on the server is configured properly, the clients should have internet.