Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Réseau] Deuxième machine sur mon LAN (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
legabier
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 231

PostPosted: Wed Sep 06, 2006 8:11 am    Post subject: [Réseau] Deuxième machine sur mon LAN (résolu) Reply with quote

Bonjour,

Mon Gentoo est un routeur. eth1 est le WAN, eth0 et eth2 le LAN.
eth0 fonctionne parfaitement depuis un an. Mon problème est que je n'arrive pas à configurer eth2.
J'ai suivi le Guide du routeur personnel pour faire mon routeur il y a un an mais aujourd'hui en suivant les explications pour ajouter des eth juste avant le point 7 du guide, mon dhcpd ne redémarre plus.

Voici à quoi ça ressemble:

# ifconfig
Code:
eth0      Lien encap:Ethernet  HWaddr 00:43:82:D2:B4:C8
          inet adr:192.168.0.1  Bcast:192.168.0.255  Masque:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27882 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32494 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000
          RX bytes:3864723 (3.6 Mb)  TX bytes:4992061 (4.7 Mb)
          Interruption:11

eth1      Lien encap:Ethernet  HWaddr 00:C2:23:65:D2:A1
          inet adr:123.123.123.123  Bcast:255.255.255.255  Masque:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:265428 errors:1 dropped:0 overruns:0 frame:0
          TX packets:180106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000
          RX bytes:124820672 (119.0 Mb)  TX bytes:118931281 (113.4 Mb)
          Interruption:11

eth2      Lien encap:Ethernet  HWaddr 00:36:84:41:E3:C8
          inet adr:192.168.2.1  Bcast:192.168.2.255  Masque:255.255.255.0
          UP BROADCAST RUNNING 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 lg file transmission:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interruption:11 Adresse de base:0xe000

lo        Lien encap:Boucle locale
          inet adr:127.0.0.1  Masque:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:36206 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36206 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0
          RX bytes:2493454 (2.3 Mb)  TX bytes:2493454 (2.3 Mb)


Je crois avoir ajouté eth2 aux bons endroits dans mes règles iptables, mais est-ce 192.168.0.0/16 ou 192.168.2.0/16 dans le FORWARD pour eth2?
Code:
Chain INPUT (policy ACCEPT)
target     prot opt in     out     source               destination
ACCEPT     all  --  lo     any     anywhere             anywhere
ACCEPT     all  --  eth0   any     anywhere             anywhere
ACCEPT     all  --  eth2   any     anywhere             anywhere
REJECT     udp  --  !eth0  any     anywhere             anywhere            udp dpt:bootps reject-with icmp-port-unreachable
REJECT     udp  --  !eth0  any     anywhere             anywhere            udp dpt:domain reject-with icmp-port-unreachable
REJECT     udp  --  !eth2  any     anywhere             anywhere            udp dpt:bootps reject-with icmp-port-unreachable
REJECT     udp  --  !eth2  any     anywhere             anywhere            udp dpt:domain reject-with icmp-port-unreachable
DROP       tcp  --  !eth0  any     anywhere             anywhere            tcp dpts:0:1023
DROP       udp  --  !eth0  any     anywhere             anywhere            udp dpts:0:1023
DROP       tcp  --  !eth2  any     anywhere             anywhere            tcp dpts:0:1023
DROP       udp  --  !eth2  any     anywhere             anywhere            udp dpts:0:1023
DROP       all  -f  eth1   any     anywhere             anywhere
DROP       tcp  --  eth1   any     anywhere             anywhere            tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,SYN,RST,ACK
DROP       tcp  --  eth1   any     anywhere             anywhere            tcp flags:FIN,SYN/FIN,SYN
DROP       tcp  --  eth1   any     anywhere             anywhere            tcp flags:SYN,RST/SYN,RST

Chain FORWARD (policy DROP)
target     prot opt in     out     source               destination
DROP       all  --  eth0   any     anywhere             192.168.0.0/16
ACCEPT     all  --  eth0   any     192.168.0.0/16       anywhere
DROP       all  --  eth2   any     anywhere             192.168.0.0/16
ACCEPT     all  --  eth2   any     192.168.0.0/16       anywhere
ACCEPT     all  --  eth1   any     anywhere             192.168.0.0/16



Mon /etc/conf.d/net
Code:
config_eth1=( "dhcp" )
config_eth0=( "192.168.0.1/24 brd 192.168.0.255" )
config_eth2=( "192.168.2.1/24 brd 192.168.2.255" )


# route -n
Code:
Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
123.123.123.0   0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         123.123.123.1   0.0.0.0         UG    0      0        0 eth1


/etc/dnsmasq.conf (seuls les deux premières étaient là avant)
Code:
domain-needed
bogus-priv
interface=eth0
interface=eth2
dhcp-range=192.168.0.100,192.168.0.250,72h
dhcp-range=192.168.2.100,192.168.2.250,72h


/etc/dhcp/dhcpd.conf (rien modifié)
Code:
authoritative;
ddns-update-style interim;
subnet 192.168.0.0 netmask 255.255.255.0 {
        range 192.168.0.100 192.168.0.250;
        default-lease-time 259200;
        max-lease-time 518400;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.0.255;
        option routers 192.168.0.1;
        option domain-name-servers 192.168.0.1;
}


Et ça ne fonctionne pas, dhcpd ne démarre plus.
Merci pour toutes vos suggestions!
_________________
Néophyte ou novice, telle est la question...


Last edited by legabier on Wed Sep 06, 2006 11:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
-KuRGaN-
Veteran
Veteran


Joined: 05 Dec 2004
Posts: 1142
Location: Besançon (25) [FRANCE]

PostPosted: Wed Sep 06, 2006 8:36 am    Post subject: Reply with quote

Si ton dhcpd ne démarre plus, tu pourrais nous poster les logs de ce service histoire d'avoir un peu plus de renseignements.
_________________
Knight Gent00 Industries RiDeR !!!!
Back to top
View user's profile Send private message
legabier
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 231

PostPosted: Wed Sep 06, 2006 8:40 am    Post subject: Reply with quote

-KuRGaN- wrote:
Si ton dhcpd ne démarre plus, tu pourrais nous poster les logs de ce service histoire d'avoir un peu plus de renseignements.

Code:
dhcpd: Can't bind to dhcp address: Address already in use
dhcpd: Please make sure there is no other dhcp server
dhcpd: running and that there's no entry for dhcp or
dhcpd: bootp in /etc/inetd.conf.   Also make sure you
dhcpd: are not running HP JetAdmin software, which
dhcpd: includes a bootp server.
dhcpd: exiting.

_________________
Néophyte ou novice, telle est la question...
Back to top
View user's profile Send private message
-KuRGaN-
Veteran
Veteran


Joined: 05 Dec 2004
Posts: 1142
Location: Besançon (25) [FRANCE]

PostPosted: Wed Sep 06, 2006 8:56 am    Post subject: Reply with quote

En fait je pense que tu as un souçis car ton dnsmasq fait serveur dhcp et c'est pour ça que le service dhcpd gueule!
Pourquoi as-tu besoin de deux serveur dhcp ???
Je pense que tu devrais en supprimer un car là ça fout la zone.
_________________
Knight Gent00 Industries RiDeR !!!!
Back to top
View user's profile Send private message
legabier
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 231

PostPosted: Wed Sep 06, 2006 8:59 am    Post subject: Reply with quote

-KuRGaN- wrote:
En fait je pense que tu as un souçis car ton dnsmasq fait serveur dhcp et c'est pour ça que le service dhcpd gueule!
Pourquoi as-tu besoin de deux serveur dhcp ???
Je pense que tu devrais en supprimer un car là ça fout la zone.


Comment je fais ça?
Le reste de ma config est-elle correct?
_________________
Néophyte ou novice, telle est la question...
Back to top
View user's profile Send private message
-KuRGaN-
Veteran
Veteran


Joined: 05 Dec 2004
Posts: 1142
Location: Besançon (25) [FRANCE]

PostPosted: Wed Sep 06, 2006 10:18 am    Post subject: Reply with quote

Et bien tu supprime un des deux services. Je te conseille de supprimer dhcpd et de ne garder que dnsmasq, tu te feras moins chier an niveau DNS.
Alors pour virer dhcpd tu fais:
Code:

/etc/init.d/dhcpd stop
rc-update del dhcpd default # le service ne serat plus lancer au démarrage


Ne le supprime pas de suite ( emerge -C dhcpd), regarde avant si la config avec dnsmasq te convient.
_________________
Knight Gent00 Industries RiDeR !!!!
Back to top
View user's profile Send private message
legabier
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 231

PostPosted: Wed Sep 06, 2006 11:40 am    Post subject: Reply with quote

Ça semble fonctionner, j'observerai le tout durant les prochaines heures, merci!
_________________
Néophyte ou novice, telle est la question...
Back to top
View user's profile Send private message
-KuRGaN-
Veteran
Veteran


Joined: 05 Dec 2004
Posts: 1142
Location: Besançon (25) [FRANCE]

PostPosted: Wed Sep 06, 2006 11:48 am    Post subject: Reply with quote

N'oublie pas de mettre (résolu) ds ton titre si cela fonctionne :wink:
_________________
Knight Gent00 Industries RiDeR !!!!
Back to top
View user's profile Send private message
legabier
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 231

PostPosted: Wed Sep 06, 2006 10:45 pm    Post subject: Reply with quote

Mes deux ordis reçoivent une IP mais pas la même que lorsque dhcpd l'attribuait, ce qui fausse toutes mes règles NAT dans iptables.
Comment configurer dnsmasq.conf pour attribuer toujours la même IP selon la MAC adresse? (man dnsmasq.conf n'existe pas :()
_________________
Néophyte ou novice, telle est la question...
Back to top
View user's profile Send private message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Wed Sep 06, 2006 10:58 pm    Post subject: Reply with quote

Tu faisais comment avant ? T'aurais pas plutot configuré ton dhcpd correctement ? Si oui, change de dhcp, stop l'autre et lance le dhcpd :D

Pour ton probz iptable, ben oui, faut attribuer une ip en fonction de la mac. Moi j'utilise dhcpd ainsi:

Code:

serveur loopx # cat /etc/dhcp/dhcpd.conf

option domain-name "blabla.com";
option domain-name-servers 10.2.1.62;
option routers 10.2.1.62;
option broadcast-address 10.2.1.63;

ddns-update-style ad-hoc;

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

authoritative;

log-facility local7;

subnet 10.2.1.0 netmask 255.255.255.192 {
  range 10.2.1.40 10.2.1.50;
}

host loop-nb {
  hardware ethernet 00:0E:35:AB:05:22;
  fixed-address 10.2.1.1;
}

host nico {
        hardware ethernet 00:04:23:66:00:C3;
        fixed-address 10.2.1.2;
}

_________________
Mon MediaWiki perso : http://pix-mania.dyndns.org
Back to top
View user's profile Send private message
legabier
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 231

PostPosted: Wed Sep 06, 2006 11:25 pm    Post subject: Reply with quote

loopx: J'ai suivi le conseil de -KuRGaN-, je n'utilise plus dhcpd, j'utilise dnsmasq uniquement.

J'ai trouvé ma réponse pour attribuer une adresse IP spécifique selon la MAC:
J'ai ajouté cette ligne dans mon dnsmasq.conf:
Code:
dhcp-host=00:43:82:D2:B4:C8,192.168.0.99

_________________
Néophyte ou novice, telle est la question...
Back to top
View user's profile Send private message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Wed Sep 06, 2006 11:53 pm    Post subject: Reply with quote

why not 8)
_________________
Mon MediaWiki perso : http://pix-mania.dyndns.org
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum