View previous topic :: View next topic |
Author |
Message |
rowdy n00b


Joined: 08 Apr 2004 Posts: 65 Location: Venlo, the Netherlands
|
Posted: Tue Apr 13, 2004 1:43 am Post subject: Routing after rebooting |
|
|
Thanx to the search function and many topics related to this, I've managed to setup a working router...
I've emerged dhcp and iptables, and added iptabled and dhcp with rc-update to default so they will start at boot. Iptables works fine, but dhcp just gives [!!] while booting, and I have to run the command dhcpd again after I have logged in.
Another problem is the ip forwarding. Everytime the system boots I have to log in and run the command
Code: | # echo 1 > /proc/sys/net/ipv4/ip_forward |
Anybody knows howto automatically start dhcpd and set ip_forward standard to 1? |
|
Back to top |
|
 |
TimG n00b


Joined: 03 Jun 2003 Posts: 62 Location: Houston, TX
|
Posted: Tue Apr 13, 2004 2:51 am Post subject: |
|
|
There is a setting in /etc/sysctl.conf that you can change that might fix your ip forwarding issue. Just uncomment it and set it to 1.
I don't know anything about the rest of your problem. Sorry. |
|
Back to top |
|
 |
joeybravo n00b


Joined: 30 Aug 2002 Posts: 45 Location: PH
|
Posted: Tue Apr 13, 2004 3:34 am Post subject: Re: Routing after rebooting |
|
|
rowdy wrote: | Thanx to the search function and many topics related to this, I've managed to setup a working router...
I've emerged dhcp and iptables, and added iptabled and dhcp with rc-update to default so they will start at boot. Iptables works fine, but dhcp just gives [!!] while booting, and I have to run the command dhcpd again after I have logged in.
Another problem is the ip forwarding. Everytime the system boots I have to log in and run the command
Code: | # echo 1 > /proc/sys/net/ipv4/ip_forward |
Anybody knows howto automatically start dhcpd and set ip_forward standard to 1? |
To fix your forwarding problem try:
Code: | nano -w /etc/conf.d/iptables |
then set the
ENABLE_FORWARDING_IPv4="yes"
Regarding your DHCP problem, i think its just an error in your config, thats causing the failure, check that again and try examining the logs.
My dhcpd.conf look something like this:
Code: |
subnet 192.168.1.0 netmask 255.255.255.0
{
option broadcast-address 192.168.1.255;
deny bootp;
option domain-name "mydomain.com";
option domain-name-servers 192.168.1.254;
default-lease-time 172800;
max-lease-time 345600;
option netbios-dd-server 192.168.1.254;
option netbios-name-servers 192.168.1.254;
option netbios-node-type 8;
option subnet-mask 255.255.255.0;
range 192.168.1.101 192.168.1.150;
option routers 192.168.1.254;
}
host eden.mydomain.com {
hardware ethernet 00:01:02:36:01:64;
fixed-address 192.168.1.151;
}
|
Please note that the internal IP address of your DHCPd server should not
be included in the range option. In my case the
DHCPd server has the 192.168.1.254 IP and the
range 192.168.1.101 192.168.1.150;
HTH
BTW, i found your post because of this thread:
The adopt an unanswered post initiative _________________ --lucky are the pessimists
for they make backups.. |
|
Back to top |
|
 |
rowdy n00b


Joined: 08 Apr 2004 Posts: 65 Location: Venlo, the Netherlands
|
Posted: Tue Apr 13, 2004 9:36 am Post subject: |
|
|
Okey, I've changed /etc/conf.d/iptables, and for as far as I know my dhcpd.conf is correct?
My dhcpd.conf:
Code: | # dhcpd.conf
option domain-name "home.nl";
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option domain-name-servers 213.51.129.170, 213.51.144.170;
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0{
range 192.168.0.2 192.168.0.254;
option broadcast-address 192.168.0.255; |
|
|
Back to top |
|
 |
joeybravo n00b


Joined: 30 Aug 2002 Posts: 45 Location: PH
|
Posted: Wed Apr 14, 2004 3:33 am Post subject: |
|
|
Are you sure you did not miss the closing "}" while copy pasting?
Quote: | # dhcpd.conf
option domain-name "home.nl";
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option domain-name-servers 213.51.129.170, 213.51.144.170;
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0{
range 192.168.0.2 192.168.0.254;
option broadcast-address 192.168.0.255;
} |
I emerge'd dhcp on my gentoo box today just to check.
I used your dhcpd.conf (with the closing "}") just to check and it won't run too.
Code: | gen2h dhcp # /usr/sbin/dhcpd eth0 -d
Internet Software Consortium DHCP Server V3.0pl2
Copyright 1995-2003 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
Can't open lease database /var/lib/dhcp/dhcpd.leases: No such file or directory --
check for failed database rewrite attempt!
Please read the dhcpd.leases manual page if you
don't know what to do about this.
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.
exiting.
|
Obviusly your [fixed]dhcpd.conf is not the problem.
It's /var/lib/dhcp/dhcpd.leases.
I fixed it by:
Code: | gen2h dhcp # touch /var/lib/dhcp/dhcpd.leases |
then..
Code: | gen2h dhcp # chown dhcp.dhcp /var/lib/dhcp/dhcpd.leases |
then tried again..
Code: | gen2h dhcp # /usr/sbin/dhcpd eth0 -d
Internet Software Consortium DHCP Server V3.0pl2
Copyright 1995-2003 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
Wrote 0 leases to leases file.
Listening on LPF/eth0/00:01:02:36:04:ea/192.168.1.0/24
Sending on LPF/eth0/00:01:02:36:04:ea/192.168.1.0/24
Sending on Socket/fallback/fallback-net
|
Code: | gen2h root # netstat -anu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 0.0.0.0:67 0.0.0.0:*
|
now i got a listener on UDP 67.... _________________ --lucky are the pessimists
for they make backups.. |
|
Back to top |
|
 |
|