Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Netwerk tussen twee ubuntu's pc's  (gelezen 3908 keer)

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Gepost op: 2006/09/18, 20:33:37 »
hoi,

Ik heb twee computers in een netwerk.  Computer-A maakt via een AlcatelUSB modem contact met het internet. Beide (A + B) computers zijn dual-boot; allebei hebben ze XP en Ubuntu. Staat op beide xp aan dan kan ik op beide internetten en netwerken. Staat op A (met USB-modem) xp opgestart, dan kan ik op computer-B met ubuntu internetten, maar niet netwerken. Staat op computer-A ubuntu opgestart kan ik wel op internet met deze A-computer maar niet met mijn B-computer. Zowel niet in xp als in ubuntu). Hoe moet ik dit oplossen?

Offline bartek

  • Lid
    • http://bartek.blogsome.com
Netwerk tussen twee ubuntu's pc's
« Reactie #1 Gepost op: 2006/09/18, 21:05:58 »
Ik heb je topic ff naar hier verplaatst. ;)
| Deliberando saepe perit occasio |

"Car la vie est un bien perdu quand on n'a pas vécu comme on l'aurait voulu"

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #2 Gepost op: 2006/09/18, 21:31:59 »
Poeh, dat is een cryptische..

Gebruik je DHCP of statische ip-adressen?

Hoe maakt computer B verbinding met het internet?

En hoe ziet je netwerk dan eruit?

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #3 Gepost op: 2006/09/18, 22:43:44 »
Hallo,

Alvast bedankt voor de reactie. Computer-A maakt met Alcatel Speedtouch modem contact met internet. Computer-B is met een cross-link kabel verbonden met computer-A. In windows-XP kan ik zo internetten en netwerken op beide pc's.
Ik maak volgens mijn netwerk (systeem-->beheer -->netwerk) gebruik van DHCP
Bijzonder is dat als mijn computer-A op windows loopt ik met computer-B in Ubuntu rustig kan internetten. Mijn conclusie is dan ook dat de hardware wel deugt maar dat ik iets in Ubuntu op compuer-A moet aanpassen, maar wat?

jpjacobs

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #4 Gepost op: 2006/09/18, 23:00:04 »
je moet op de ubuntu-bak die rechtstreeks op internet zit dnsmasq draaien. of iets anders wat ook dhcp server speelt.
Een mooie (en werkende) howto is te vinden op www.gentoo.org/doc/en/home-router-howto.xml
enkel ipv emerge , apt-get gebruiken.
Groeten,
JP

Offline Tukcedo

  • Lid
    • http://www.tukcedo.nl
Netwerk tussen twee ubuntu's pc's
« Reactie #5 Gepost op: 2006/09/19, 10:44:25 »
Het probleem is dat je computer B geen mogelijkheid heeft tot direct contact met internet. Je zult op de computer die contact legt met het internet z.g. NAT (Network Address Translation) moeten aanzetten, waarbij deze dus gaat fungeren als router voor de andere. Je doet dit met de netfilter/iptables utilities (www.netfilter.org). Als je een beetje rond-googled zul je er complete firewall en NATting scripts vinden die je zo kunt gebruiken.
Tukcedo Services - Unix en Linux Consultants
http://www.tukcedo.nl

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #6 Gepost op: 2006/09/19, 20:18:49 »
Hallo allemaal,

Verrast door de reacties. Geweldig. Ik begrijp dat ik DHCP sever moet opzetten met dnsmasq. IK volg de documatatie zoals die werd aangegeven op: www.gentoo.org/doc/en/home-router-howto.xml . Dan loop ik tegen het volgende probleem aan: bij Code Listing 5.1:  Setting up a DHCP server, moet ik als root intikken: # rc-update add dnsmasq default
Maar dit commando herkent de shell niet! Ik vind het ook niet als ik dnsmasq -help opvraag. Suggesties?
 Gegroet alle hulpvaardigen.
johnux

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #7 Gepost op: 2006/09/20, 12:46:56 »
Hallo weer,

rc-update is een Gentoo commando, je zult voor Ubuntu update-rc.d moeten gebruiken. Als het dnsmasq commando niet herkent wordt, dan zal je deze nog moeten installeren. (dit kun je trouwens ook te weten komen, als je in console de eerste letter(s) intypt en dan twee keer tab drukt) Installeren kun je of met synaptic of in terminal met:

sudo apt-get install dnsmasq

Mocht hij niet gevonden worden, dan zal je eerst nog je sources.list aan moeten passen, zie ook:

https://wiki.ubuntu.com/NlAddingRepositoriesHowto
https://wiki.ubuntu.com/NlSynapticHowto

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #8 Gepost op: 2006/09/20, 17:03:45 »
Hallo,

dnsmasq is geinstalleerd. Daarna heb ik dnsmasq.conf aangepast met de volgende regels: dhcp-range=192.168.0.100,192.168.0.250,72h
                         interface=eth0

Vervolgens het commando: update-rc.d add dnsmasq default
dan antwoordt de shell: update-rc.d: /etc/init.d/add: file does not exist

Terzijde: Ik heb nog even gekeken in /etc/init.d  en inderdaad geen add file, wel adt: is dat hetzelfde? Ook vond ik dnsmasq in /etc/init.d.

Ave

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #9 Gepost op: 2006/09/21, 12:49:45 »
Ik heb zelf heel even met Gentoo gewerkt en deze vereist veel meer handmatige configuratie dan Ubuntu. De 'add' optie is, naar ik meen, voor het Gentoo commando 'rc-update'. Je kunt dus voor Ubuntu gebruiken:

sudo update-rc.d dnsmasq defaults

Wanneer je dit ingevoerd hebt, krijg je waarschijnlijk de melding dat de verwijzing al bestaat. Dit is dus het verschil tussen Ubuntu en Gentoo. Het zou goed kunnen dat er nog meer dingen in de manual staan, die niet handmatig in Ubuntu ingesteld hoeven te worden. Het beste zou je dan ook een debian gebasseerde, of het liefst Ubuntu gebaseerde manual moeten zoeken. Niet dat het met de Gentoo manual niet zou lukken, maar je moet wel meer opletten en beseffen dat niet alles voor Ubuntu geldt.

suc6

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #10 Gepost op: 2006/09/21, 15:18:03 »
Ave socratux,

Het lukt mij inderdaad:

john@slaapkamer:~$ sudo update-rc.d dnsmasq defaults
 System startup links for /etc/init.d/dnsmasq already exist.
john@slaapkamer:~$ sudo /etc/init.d/dnsmasq start
Starting DNS forwarder and DHCP server: dnsmasq (already running).

Ik zou nu toch contact met mijn andere computer moeten hebben, maar waar moet ik zoeken? Ik zoek dan onder systeem -> beheer -> netwerk maar daar vind ik niets. Wel staan daar op het tablad DNS twee DNS servers:
195.121.1.34 en 195.121.1.66. Staat hier mijn tweede computer bij? en hoe kom ik daar in. Ik heb de persoonlijke map daar op "delen" gezet.

Wat voor mij ook een raadsel blijft, dat zijn die IPtables. Inmiddels een drietal doc's gelezen o.a. http://home.nedlinux.nl/~bart/?page=3 waardoor de theorie mij wel duidelijk is maar nu de praktijk. Onder synaptic vond ik een firewall (lokkit) die ik maar geinstalleerd heb. Uit de bij geleverde documentatie begreep ik dat het hele IPtables gebeuren dan geregeld is. Toen weer geprobeerd om met mij andere pc op het internet te komen, maar helaas? Welke stap vergeet ik?
Tsjonge, tsjonge het is dan wel een "steep learning curve", maar wel een "long steep learning curve". Maar vooruit; onder het motto "Nil volentibus arduum est" ga ik verder.

Hartelijke groet

Johnux

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #11 Gepost op: 2006/09/21, 21:32:34 »
gegroet Johnux,

Citaat
Ik zou nu toch contact met mijn andere computer moeten hebben, maar waar moet ik zoeken?
Je moet op de 'client' pc via dhcp een ip-adres krijgen, dus dhcp-client draaien. Wat zegt:

ifconfig -a

Citaat
Wel staan daar op het tablad DNS twee DNS servers:
195.121.1.34 en 195.121.1.66.
Dit zulllen de primaire en secundaire nameservers van je provider zijn.

Citaat
Wat voor mij ook een raadsel blijft, dat zijn die IPtables. Inmiddels een drietal doc's gelezen o.a. http://home.nedlinux.nl/~bart/?page=3 waardoor de theorie mij wel duidelijk is maar nu de praktijk. Onder synaptic vond ik een firewall (lokkit) die ik maar geinstalleerd heb. Uit de bij geleverde documentatie begreep ik dat het hele IPtables gebeuren dan geregeld is. Toen weer geprobeerd om met mij andere pc op het internet te komen, maar helaas? Welke stap vergeet ik?
Ik ben helaas niet bekend met het pakket lokkit, klinkt overigens wel interessant; dat iptables dan meteen geregeld wordt. Anders had je dit nog apart moeten doen.

Even kijken, ik denk dat je het best even alle gegevens die je hebt ingevoerd in lokkit even hier neerzet. Nu is het moeilijk te zien, waar het probleem ligt. Ik neem aan dat je wel telkens van jouw eigen situatie bent uitgegaan met ip's e.d. (had net zo goed een 10.0.0.x netwerk kunnen zijn)

Losstaand van of het lokkit pakket werkt, wat iptables/NAT configureert, zou je nu wel al een ip adres moeten krijgen en op je LAN moeten kunnen werken. (probeer een ping) Doet dit het niet, dan zit het hem toch nog ergens eerder in de configuratie.

Dus eerst je LAN werkent zien te krijgen en daarna stap twee het internet (met lokkit in jouw geval)

Citaat
Tsjonge, tsjonge het is dan wel een "steep learning curve", maar wel een "long steep learning curve". Maar vooruit; onder het motto "Nil volentibus arduum est" ga ik verder.
Het koste mij veel moeite mijn Latijn weer boven te halen, uiteindelijk toch maar voor de ontbrekende delen even gegoogled;

Niets is onmogelijk voor hen die willen!   :) idd, erg mooi...

1tje die ik ook mooi vindt: festina lente (zo heet een rusthuis bij mij in de buurt overigens :P)

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #12 Gepost op: 2006/09/21, 23:06:55 »
Salve Socratux

Alweer bedankt voor je reactie. Maar inderdaad: haast u langzaam!


Als ik op mijn b-computer (dat is de client, neem ik aan; Computer-a is mijn gateway) ifconfig -a draai, krijg ik dit:
john@zolder:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:C1:26:04:3F:FE
          inet6 addr: fe80::2c1:26ff:fe04:3ffe/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1710 (1.6 KiB)  TX bytes:2520 (2.4 KiB)
          Interrupt:11 Base address:0x2000

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:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:272 (272.0 b)  TX bytes:272 (272.0 b)

sit0      Link encap:IPv6-in-IPv4
          NOARP  MTU:1480  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:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


Als ik dan op diezelfde comp bij netwerk tools kijk dat staat er onder apparaten: netwerkapparaat: loopbackinterface
en bij IP-informatie Netwerkapparaat:   Ipv4   127.0.0.1 255.0.0.0
                  Ipv6  ::1   128      host

kijk ik op het tabblad 'ping' dan vul ik 127.0.0.1 in, druk op de ping knop en dan krijg ik:
   64    127.0.0.1      1   0.099 ms
   64    127.0.0.1      2   0.075 ms
   64    127.0.0.1      3   0.083 ms
   64    127.0.0.1      4   0.077 ms
   64    127.0.0.1      5   0.079 ms

daaronder staat dan:

Heen en weer statistiek      Verzendstatistiek

Minimum  0.08 ms         Pakketen verzonden:    5
Gemiddeld 0.09 ms         Paketten onvangen:      5
Maximum 0.10 ms         Paket verlies       0%


Verder nog dit:
Wanneer ik op mijn computer -a kijk bij netwerk (systeem ->beheer -> netwerk) dan valt het mij op dat er wel een eth0 genoemd wordt maar geen modem. Nu heb ik een USBmodem, nl een speedtouch330, welke ik aan het werk heb gekregen met een HOWTO welke ik op het internet gevonden heb. Schijnbaar wordt die niet herkend in mijn netwerk (systeem ->beheer -> netwerk)Mogelijk ligt hier ook een probleem.

Voor wat betreft Lokkit. Dat is een grafisch programmaatje waar je op een paar vragen ja of nee moet antwoorden. http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/s1-basic-firewall-gnomelokkit.html
Ik heb voor low security gekozen. Dus verder al de simpele vragen beantwoord. Allemaal heel simpel, dus daar kwam ik wel uit, ha, ha (althans dat hoop ik)!

Nesciens te salutant

Johnux

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #13 Gepost op: 2006/09/21, 23:28:54 »
ola,

Uit de output van ifconfig -a blijkt dat er kennelijk nog geen ip-adres verkregen is.

Met de ping bedoelde ik eigenlijk het ip-adres van de andere pc. Dit zal niet lukken aangezien je geen ip hebt gekregen. Localhost houdt in dat je naar jezelf pingt, zo kun je zien dat de kaart het iig doet.

Dus op jouw computer -a heb je verbinding met het internet via je modem, alleen wordt deze niet weergegeven? Wat geeft op deze pc ifconfig -a?
Kun je de manual nog terugvinden?

Maar losstaand van je USB-modem moet je op comp. a met eth0 al verbinding met comp. b moeten kunnen maken.

Heb je wel de kaart in comp. b op dhcp gezet?

Ik ga zo slapen, het was weer een mooie lange dag. Morgen zal ik verder kijken.

Nunc est bibendum

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #14 Gepost op: 2006/09/22, 20:03:39 »
Hallo Socratux,

De ifconfig van mijn A-computer (degene die dus met het internet verbonden is):

john@slaapkamer:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:07:95:A9:48:19
          inet6 addr: fe80::207:95ff:fea9:4819/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:63 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3780 (3.6 KiB)  TX bytes:1494 (1.4 KiB)
          Interrupt:11 Base address:0xd400

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:71 errors:0 dropped:0 overruns:0 frame:0
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5448 (5.3 KiB)  TX bytes:5448 (5.3 KiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:145.53.110.190  P-t-P:195.190.249.65  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:175 errors:0 dropped:0 overruns:0 frame:0
          TX packets:174 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:154630 (151.0 KiB)  TX bytes:15832 (15.4 KiB)

sit0      Link encap:IPv6-in-IPv4
          NOARP  MTU:1480  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:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Ik heb verder nog even gecheckt of bij computer_b de kaart op DHCP staat, en dat staat ie.

De manual voor wat betreft het installeren van mijn modem Speedtouch is deze: http://www.linux-usb.org/SpeedTouch/ubuntu/  
Ik heb dus de ppp over ATM versie geinstalleerd. Toch denk ik dat hier een belangrijke schakel in het gehele probleem ligt. Als ik ifconfig zie dan valt mij op dat ppp0 hierbij staat. Echter op het netwerkscherm  (systeem ->beheer->netwerk) vind ik deze niet terug. Op dat scherm staat wel dat mijn eth0 kaart actief is, maar bij mijn modemverbinding staat: de interface ppp0 is niet geconfigureerd. Als ik dat probeer te doen via eigenschappen dan krig ik een tabblad waar ik gegevens van een inbelmodem in moet vullen! Verder staat op het tabblad verbindingen bij standaard gateway niets; geheel blanco, maar als ik op dit blanco schermpje klik verschijnt er eth0, en dat is nou net niet mijn internet verbinding maar mijn netwerkkaart. Ik kan ook niets anders selecteren in dit standaard gateway scherm.
Mijn voorlopige hypothese (voor wat het waard is) is dan ook dat ubuntu niet geheel door heeft dat er een USB-modem geinstalleerd is, omdat dit niet op de gebruikelijk weg is gegaan, nl via synaptic. Want anders zou ik dit toch terug moeten zien in het netwerkscherm! Vervolgens "denkt" ubuntu dat mijn netwerkkaart mijn internetverbinding is.
Nou ja, ik hoop dat dit iets bijdraagt. Vergeef mijn wat vrijmoedige hypothese, ben tenslotte maar een newbie.

Ille, qui nesciens adhuc, te salutat
(Hij, die het nog steeds niet weet, groet u)

Johnux

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #15 Gepost op: 2006/09/23, 14:54:11 »
Ik denk dat we het beste het even in een aantal stappen op kunnen delen.

De basis om de pc's te laten communiceren zijn dnsmasq op de pc1, die dan dhcp/dns server draait. En dhcp-client op de comp2.

Aangezien bij het configureren van meedere verbindingen op 1 pc, er wel eens foutjes kunnen optreden, zetten we de ppp0 uit en gaan we puur de eth0 kaart proberen te laten werken:

sudo ifconfig ppp0 down

Zo kan deze even niet in de weg zitten, en ook zoals jij zelf al aangaf vanwege de alternatieve installatie van het modem.

Misschien kun je nu al, mocht de configuratie van eth0 op pc1 goed zijn de eth0 juist activeren:

sudo ifconfig eth0 up

Kijk voor de zekerheid of de services ook draaien:

ps aux | grep dnsmaq

Naast het grep proces moet je dus ook nog het dnsmasq proces zien.
Draait dnsmasq en is de kaart actief, dan zou je dus met deze minimale opstelling al een ip-adres moeten krijgen op pc2 met de dhcp-client. Controleer of de dhcp-client draait als proces met:

ps aux | grep dhcp

Mocht het nog steeds niet werken, dan moet er waarschijnlijk bij dnsmasq iets aangepast worden.

Hoe zie je /etc/dnsmasq.conf eruit?

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #16 Gepost op: 2006/09/23, 19:12:02 »
Hallo socratux,

Na "sudo ifconfig ppp0 down" en "sudo ifconfig eth0 up" heb ik  ps aux | grep dnsmaq  gedaan (alles op computer-a:

john@slaapkamer:~$ sudo ifconfig ppp0 down
Password:
john@slaapkamer:~$ sudo ifconfig eth0 up
john@slaapkamer:~$ ps aux | grep dnsmasq
dnsmasq   4571  0.0  0.0   1828   696 ?        S    16:43   0:00 /usr/sbin/dnsmasq -u dnsmasq
john      5613  0.0  0.0   2888   824 pts/0    S+   16:47   0:00 grep dnsmasq
john@slaapkamer:~$

Dan op de computer-b dhpc client gedaan:
john@zolder:~$ ps aux | grep dhcp
dhcp      3473  0.0  0.2   2336   768 ?        Sjohn      5414  0.0  0.3   2888   820 pts/0    S+   16:48   0:00 grep dhcp
john@zolder:~$

Daarna geprobeerd verbinding met elkaar te maken via Locaties ->netwerkservers  of met locaties->verbinden met server. Maar dit levert niets op. Doe ik dat eigenlijk wel goed? Hoe controleer ik of ze verbinding met elkaar hebben. Ik heb bij beide de persoonlijke map op delen gezet. Is dat juist?

En dan het bestand dnsmasq.conf (oef, dat is een enorm bestand, maar hier komt het):
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.

# The following two options make you a better netizen, since they
# tell dnsmasq to filter out queries which the public DNS cannot
# answer, and which load the servers (especially the root servers)
# uneccessarily. If you have a dial-on-demand link they also stop
# these requests from bringing up the link uneccessarily.

# Never forward plain names (without a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv


# Uncomment this to filter useless windows-originated DNS requests
# which can trigger dial-on-demand links needlessly.
# Note that (amongst other things) this blocks all SRV requests,
# so don't use it if you use eg Kerberos.
# This option only affects forwarding, SRV records originating for
# dnsmasq (via srv-host= lines) are not suppressed by it.
#filterwin2k

# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=

# By  default,  dnsmasq  will  send queries to any of the upstream
# servers it knows about and tries to favour servers to are  known
# to  be  up.  Uncommenting this forces dnsmasq to try each query
# with  each  server  strictly  in  the  order  they   appear   in
# /etc/resolv.conf
#strict-order

# If you don't want dnsmasq to read /etc/resolv.conf or any other
# file, getting its servers from this file instead (see below), then
# uncomment this
#no-resolv

# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
# files for changes and re-read them then uncomment this.
#no-poll

# Add other name servers here, with domain specs if they are for
# non-public domains.
#server=/localnet/192.168.0.1

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
#local=/localnet/

# Add domains which you want to force to an IP address here.
# The example below send any host in doubleclick.net to a local
# webserver.
#address=/doubleclick.net/127.0.0.1

# If you want dnsmasq to change uid and gid to something other
# than the default, edit the following lines.
#user=
#group=

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=
# Or you can specify which interface _not_ to listen on
#except-interface=
# Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.)
#listen-address=
# If you want dnsmasq to provide only DNS service on an interface,
# configure it as shown above, and then use the following line to
# disable DHCP on it.
#no-dhcp-interface=

# On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of
# working even when interfaces come and go and change address. If you
# want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine.
#bind-interfaces

# If you don't want dnsmasq to read /etc/hosts, uncomment the
# following line.
#no-hosts
# or if you want it to read another file, as well as /etc/hosts, use
# this.
#addn-hosts=/etc/banner_add_hosts

# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.
#expand-hosts

# Set the domain for dnsmasq. this is optional, but if it is set, it
# does the following things.
# 1) Allows DHCP hosts to have fully qualified domain names, as long
#     as the domain part matches this setting.
# 2) Sets the "domain" DHCP option thereby potentially setting the
#    domain of all systems configured by DHCP
# 3) Provides the domain part for "expand-hosts"
#domain=thekelleys.org.uk

# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
#dhcp-range=192.168.0.50,192.168.0.150,12h

# This is an example of a DHCP range where the netmask is given. This
# is needed for networks we reach the dnsmasq DHCP server via a relay
# agent. If you don't know what a DHCP relay agent is, you probably
# don't need to worry about this.
#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h

# This is an example of a DHCP range with a network-id, so that
# some DHCP options may be set only for this network.
#dhcp-range=red,192.168.0.50,192.168.0.150

# Supply parameters for specified hosts using DHCP. There are lots
# of valid alternatives, so we will give examples of each. Note that
# IP addresses DO NOT have to be in the range given above, they just
# need to be on the same network. The order of the parameters in these
# do not matter, it's permissble to give name,adddress and MAC in any order

# Always allocate the host with ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60
#dhcp-host=11:22:33:44:55:66,192.168.0.60

# Always set the name of the host with hardware address
# 11:22:33:44:55:66 to be "fred"
#dhcp-host=11:22:33:44:55:66,fred

# Always give the host with ethernet address 11:22:33:44:55:66
# the name fred and IP address 192.168.0.60 and lease time 45 minutes
#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m

# Give the machine which says it's name is "bert" IP address
# 192.168.0.70 and an infinite lease
#dhcp-host=bert,192.168.0.70,infinite

# Always give the host with client identifier 01:02:02:04
# the IP address 192.168.0.60
#dhcp-host=id:01:02:02:04,192.168.0.60

# Always give the host with client identifier "marjorie"
# the IP address 192.168.0.60
#dhcp-host=id:marjorie,192.168.0.60

# Enable the address given for "judge" in /etc/hosts
# to be given to a machine presenting the name "judge" when
# it asks for a DHCP lease.
#dhcp-host=judge

# Never offer DHCP service to a machine whose ethernet
# address is 11:22:33:44:55:66
#dhcp-host=11:22:33:44:55:66,ignore

# Ignore any client-id presented by the machine with ethernet
# address 11:22:33:44:55:66. This is useful to prevent a machine
# being treated differently when running under different OS's or
# between PXE boot and OS boot.
#dhcp-host=11:22:33:44:55:66,id:*
# Send extra options which are tagged as "red" to
# the machine with ethernet address 11:22:33:44:55:66
#dhcp-host=11:22:33:44:55:66,net:red

# Send extra options which are tagged as "red" to
# any machine with ethernet address starting 11:22:33:
#dhcp-host=11:22:33:*:*:*,net:red

# Send extra options which are tagged as "red" to any machine whose
# DHCP vendorclass string includes the substring "Linux"
#dhcp-vendorclass=red,Linux

# Send extra options which are tagged as "red" to any machine one
# of whose DHCP userclass strings includes the substring "accounts"
#dhcp-userclass=red,accounts

# If this line is uncommented, dnsmasq will read /etc/ethers and act
 on the ethernet-address/IP pairs found there just as if they had
# been given as --dhcp-host options. Useful if you keep
# MAC-address/host mappings there for other purposes.
#read-ethers

# Send options to hosts which ask for a DHCP lease.
# See RFC 2132 for details of available options.
# Note that all the common settings, such as netmask and
# broadcast address, DNS server and default route, are given
# sane defaults by dnsmasq. You very likely will not need any
# any dhcp-options. If you use Windows clients and Samba, there
# are some options which are recommended, they are detailed at the
# end of this section.
# For reference, the common options are:
# subnet mask - 1
# default router - 3
# DNS server

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #17 Gepost op: 2006/09/23, 19:56:59 »
Citaat
Na "sudo ifconfig ppp0 down" en "sudo ifconfig eth0 up" heb ik  ps aux | grep dnsmaq  gedaan (alles op computer-a:

john@slaapkamer:~$ sudo ifconfig ppp0 down
Password:
john@slaapkamer:~$ sudo ifconfig eth0 up
john@slaapkamer:~$ ps aux | grep dnsmasq
dnsmasq   4571  0.0  0.0   1828   696 ?        S    16:43   0:00 /usr/sbin/dnsmasq -u dnsmasq
john      5613  0.0  0.0   2888   824 pts/0    S+   16:47   0:00 grep dnsmasq
john@slaapkamer:~$

Dan op de computer-b dhpc client gedaan:
john@zolder:~$ ps aux | grep dhcp
dhcp      3473  0.0  0.2   2336   768 ?        Sjohn      5414  0.0  0.3   2888   820 pts/0    S+   16:48   0:00 grep dhcp
john@zolder:~$
so far so good :)

Citaat
Daarna geprobeerd verbinding met elkaar te maken via Locaties ->netwerkservers  of met locaties->verbinden met server. Maar dit levert niets op. Doe ik dat eigenlijk wel goed? Hoe controleer ik of ze verbinding met elkaar hebben. Ik heb bij beide de persoonlijke map op delen gezet. Is dat juist?
Je kan met de pc 2 op dezelfde manier als normaal met je router verbinding maken. Dus je stelt je kaart in op dhcp.(helaas weet ik het niet precies waar in Ubuntu, ik dacht in het menu rechtsboven en dan bij system of configuration misscchien. Dan moet er ergens network devices staan of iets in die trand)
Je moet dus een ip-adres uitgedeelt krijgen door de server. Je kan het netwerk testen door 'te pingen' Dit kun je zo doen:

ping 192.168.0.1 (Dit is het ip-adres zoals in de manual wordt aangegeven te gebruiken)

Maar voor dat je dit allemaal gaat doen, ik vond in de manual het volgende bij 4.1:

# nano /etc/conf.d/net
Add a line like the following:
config_eth0=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )

Maar deze locatie is niet juist voor Ubuntu, dit zou hier moeten gebeuren:
/etc/default/dhcp3-server

Ik heb hier nog een link voor Ubuntu, die is wat meer compatible met het systeem:
http://ubuntuguide.org/wiki/Dapper (zoek even op dhcp-server)

Je ziet het verschil al met Gentoo ;)
De server zal wel al geinstalleerd zijn, alleen de configuratie file verschilt..

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #18 Gepost op: 2006/09/24, 22:07:26 »
Hallo socratux

Ik heb gepingd naar mijn pc-a (nadat ik eerst weer mijn ppp0 op down gezet had via ifconfig): network not reached

Daarna nog het bestand dhcp3-server opgezocht in /etc/default. Dit bestand was niet aanwezig. Dat heb ik dus via synaptic geinstalleerd en daar na die zin toegevoegd. Moeten overigens de haakjes niet verwijderd worden? Het bestand zit er nu zo uit:

# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=" "
config_eth0=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )

Als laatste vraag: Was mijn masq.conf wel in orde?

socratux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #19 Gepost op: 2006/09/25, 12:33:32 »
Citaat
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=" "
config_eth0=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )
Je moet de gegevens van Gentoo niet overnemen, dit werkt nogal verwarrend omdat een Gentoo systeem heel anders is opgebouwd dan een Ubuntu systeem.

Maar als je van de Ubuntu-link die ik gaf alles stap voor stap uitvoert dan zal hij het gaan doen. Je ziet in deze manual dat het aangeven van de interface en netmasks e.d. anders moet dan als met Gentoo.
De oude Gentoo configuratie kan je dan ook weggooien.

Als je de dhcp-server volgens de Ubuntu-manual hebt geinstalleerd, dan zou je nu een ip-adres op de computer b moeten krijgen. Ping weer even naar 192.168.0.1 om te kijken of je kan communiceren.

Citaat
Als laatste vraag: Was mijn masq.conf wel in orde?
Het ziet er goed uit :), overigens alle regels met een # ervoor worden niet meegenomen in het script, dus eigenlijk staat alleen dit erin:

dhcp-range=192.168.0.100,192.168.0.250,72h
interface=eth0

Wanneer je dhcp-server het doet, kun je nu je ppp0 interface weer activeren:

sudo ifconfig ppp0 up

En hopen dat alles het nu doet :D

johnux

  • Gast
Netwerk tussen twee ubuntu's pc's
« Reactie #20 Gepost op: 2006/09/27, 22:34:48 »
Ave socratux

Helaas, na werkelijk alle goede raad opgevolgd te hebben, lukt het nog steeds niet. DHCP keurig geinstalleerd, dnsmasq ingesteld, gepingd, etc, etc, etc......................

Ik geef het (voorlopig) op. Kost helaas teveel tijd. In ieder geval hartelijk dank voor de moeite!!

Ille, qui nesciens adhuc, te salutat