Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-03-2004, 09:38 PM   #1
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
dhcp and internet sharing connectin problem

I have Gentoo ( as server ) and Windows XP ( as client ). Gentoo has two interface cards. eth0 and eth1. Eth0 is for wan and eth1 is for lan. Gentoo has internet connection from ISP and I want to share it with Windows XP ( client ). I want it that way so Windows XP grab internet connection ( and ip address ) from Gentoo ( server ) with dhcp way automatically. No need to configure ip address manually in client. Just set it to obtain ip address automatically. Here is the detail of the server:

" broadcast netmask"

ifconfig_eth1=( "dhcp" )
DNSMASQ_OPTS="--interface=eth0 -F,"
subnet netmask {
  ddns-update-style interim;
  default-lease-time 76400;
  max-lease-time 86400;
  option routers;
  option ip-forwarding on;
  option broadcast-address;
  option subnet-mask;
  option domain-name-servers,;
  option domain-name "";
  option netbios-name-servers;
Then I do this step:
# /etc/init.d/net.eth1 restart
* Bringing eth1 down ...
* Removing inet6 addresses
* eth1 inet6 del fe80::205:blabla:fe31:dbfb/64 [ ok ]
* Releasing DHCP lease for eth1 [ ok ]
* Stopping eth1 [ ok ]
* Bringing eth1 up ...
* eth1 dhcp [ ok ]
# /etc/init.d/net.eth0 restart
* Stopping eth0
* Bringing down eth0
* Removing inet6 addresses
* eth0 inet6 del fe80::2e0:blabla:fe00:1936/64
* Shutting down eth0 ... [ ok ]
* Starting eth0
* Bringing up eth0
* eth0 [ ok ]
# /etc/init.d/dnsmasq restart
* Stopping dnsmasq ... [ ok ]
* Starting dnsmasq ... [ ok ]
# /etc/init.d/dhcp restart
* Setting ownership on dhcpd.leases ... [ ok ]
* Starting dhcpd ... [ !! ]

So how do I know what's wrong?????

And if I success to run dhcp server, what iptables command ( script ) must I run so that Windows XP ( client ) can connect to internet through Gentoo with medium security?

Thank you.
Old 11-03-2004, 09:57 PM   #2
Registered: Jan 2003
Location: cyberjaya
Distribution: rh mdk deb fed suse
Posts: 99

Rep: Reputation: 15
i never use gentoo b4, but u can try look at the log, maybe /var/log/messages to check what went wrong with ur dhcpd

and for iptables try this

iptables -A POSTROUTING -s -o eth0 -j SNAT --to-source

make sure your /proc/sys/net/ipv4/ip_forward = 1
Old 11-03-2004, 11:11 PM   #3
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Original Poster
Rep: Reputation: 31
Nov  4 18:09:06 [su(pam_unix)] session opened for user root by knight(uid=1000)
Nov  4 18:09:14 [dhcpd] ** You must add a ddns-update-style statement to /etc/dhcp/dhcpd.conf.
Nov  4 18:09:14 [dhcpd] To get the same behaviour as in 3.0b2pl11 and previous
Nov  4 18:09:14 [dhcpd] versions, add a line that says "ddns-update-style ad-hoc;"
Nov  4 18:09:14 [dhcpd] Please read the dhcpd.conf manual page for more information. **
Nov  4 18:09:14 [dhcpd] If you did not get this software from, please
Nov  4 18:09:14 [dhcpd] get the latest from and install that before
Nov  4 18:09:14 [dhcpd] requesting help.
Nov  4 18:09:14 [dhcpd] If you did get this software from and have not
Nov  4 18:09:14 [dhcpd] yet read the README, please read it before requesting help.
Nov  4 18:09:14 [dhcpd] If you intend to request help from the
Nov  4 18:09:14 [dhcpd] mailing list, please read the section on the README about
Nov  4 18:09:14 [dhcpd] submitting bug reports and requests for help.
Nov  4 18:09:14 [dhcpd] Please do not under any circumstances send requests for
Nov  4 18:09:14 [dhcpd] help directly to the authors of this software - please
Nov  4 18:09:14 [dhcpd] send them to the appropriate mailing list as described in
Nov  4 18:09:14 [dhcpd] the README file.
Nov  4 18:09:14 [dhcpd] exiting.
So how do I fix my dhcp server problem? I don't understand this....
Old 11-04-2004, 01:05 PM   #4
LQ Newbie
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
try setting this line in your dhcpd.conf:

ddns-update-style ad-hoc;

DONT set it in your subnet declaration as you have done but put it at the top of your dhcpd.conf. Extract from my dhcpd.conf:

# dhcpd.conf
# Sample configuration file for ISC dhcpd

# option definitions common to all supported networks...
#option domain-name "";
#option domain-name-servers;

option wpad-url code 252 = text;
option wpad-url "";

ddns-update-style ad-hoc;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

#subnet netmask {

# This is a very basic subnet declaration.

subnet netmask {
option routers;
option domain-name "";


By the way, is your routing working now?
I use masquarading instead of source nat:


I would be surprised if source nat would work for your purposes.
Old 11-04-2004, 01:09 PM   #5
LQ Newbie
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
I made a mistake about the nat problem. Since you're using a static ip, source nat is okay
Old 11-05-2004, 07:13 AM   #6
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Original Poster
Rep: Reputation: 31
Hi, my internet sharing connection works perfect now by using dnsmasq. No need dhcp server. By the way, thanx for your help. If I need help using dhcp server, I will read this thread.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Sharing w/o DHCP Server Mookid77 Mandriva 1 07-20-2004 08:18 AM
Internet sharing and dhcp trouble iceaway Mandriva 2 03-12-2004 04:50 PM
Internet connection sharing and dhcp SolidSnake Linux - Networking 26 12-02-2003 11:23 AM
Sharing internet between DHCP protocol? tr4nce Linux - Networking 10 03-25-2003 07:38 PM
Internet Sharing & DHCP problem? Help! hakanicduygu Linux - Networking 4 01-25-2003 02:18 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration