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

Notices


Reply
  Search this Thread
Old 11-03-2004, 09:38 PM   #1
melinda_sayang
Member
 
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:

/etc/conf.d/net
Code:
ifconfig_eth0=(
"192.168.1.78 broadcast 192.168.1.255 netmask 255.255.255.0"
)

ifconfig_eth1=( "dhcp" )
/etc/conf.d/dnsmasq
Code:
DNSMASQ_OPTS="--interface=eth0 -F 192.168.0.2,192.168.0.254"
/etc/dhcpd.conf
Code:
subnet 192.168.1.0 netmask 255.255.255.0 {
  ddns-update-style interim;
  range 192.168.1.10 192.168.1.100;
  default-lease-time 76400;
  max-lease-time 86400;
  option routers 192.168.1.78;
  option ip-forwarding on;
  option broadcast-address 192.168.1.255;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.1.1 204.127.198.4, 63.240.76.4;
  option domain-name "akbarhome.com";
  option netbios-name-servers 192.168.1.1;
}
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 192.168.1.78 [ 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
ashamril
Member
 
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 192.168.1.0/255.255.255.0 -o eth0 -j SNAT --to-source 192.168.1.78

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

Original Poster
Rep: Reputation: 31
Code:
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 ftp.isc.org, please
Nov  4 18:09:14 [dhcpd] get the latest from ftp.isc.org 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 ftp.isc.org 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 dhcp-server@isc.org
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
ignarus
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 "shadownet.org";
#option domain-name-servers 192.168.0.1;

option wpad-url code 252 = text;
option wpad-url "http://wpad.shadownet.org/wpad.dat";

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.
authoritative;

# 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 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.254;
option routers rtr.shadownet.org;
option domain-name "shadownet.org";

...

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

IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

I would be surprised if source nat would work for your purposes.
 
Old 11-04-2004, 01:09 PM   #5
ignarus
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
melinda_sayang
Member
 
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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