Mam problem z poprawnym uruchomieniem serwera DHCP
Musze stworzyć sieć w topologi mniej więcej jak na rysunku:
http://img823.imageshack.us/img823/1596/beztytuuizt.jpg
Podam krótki opis jak wszystko powinno działać.
W programie VirtualBox zainstalowane mam 3 linuxy, ubuntu1, ubuntu2, ubuntu3.
Ubuntu1 posiada 2 karty sieciowe: eth0 i eth1
karta eth0 posiada dostęp do internetu (zmostkowana z VirtualBoxem) , karta eth1 odpowiedzialna jest za routing z hostami ubuntu2 i ubuntu3 (ustawienie karty na Host-only)
W ubuntu1 na interfejsie eth1 zainstalowałem serwer dhcp, serwer już się uruchamia poprawnie ale w momencie uruchomienia ubuntu2 lub ubuntu3 nie przydziela poprawnie adresów tym jednostkom, komputer ubuntu2 na moje oko pobiera adres z VirtualBoxa (który ma wbudowany swój serwer dhcp) i komputery się z sobą nie kontaktują.
wrzucę kilka linijek z terminala aby było wiadomo o co mi chodzi.
Ifconfig z ubuntu1
Kod: Zaznacz cały
ubuntu1@ubuntu1:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:be:c7:ed
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:febe:c7ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12266 errors:0 dropped:0 overruns:0 frame:0
TX packets:9104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13615447 (13.6 MB) TX bytes:1285125 (1.2 MB)
eth1 Link encap:Ethernet HWaddr 08:00:27:17:6b:0c
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe17:6b0c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:537 errors:0 dropped:0 overruns:0 frame:0
TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:90529 (90.5 KB) TX bytes:28615 (28.6 KB)
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:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:480 (480.0 B) TX bytes:480 (480.0 B)
ubuntu1@ubuntu1:~$
Kod: Zaznacz cały
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 77.65.128.2,82.160.2.3;
range 192.168.0.2 192.168.0.24;
default-lease-time 21600;
max-lease-time 86400;
}
serwer startuje
Kod: Zaznacz cały
ubuntu1@ubuntu1:~$ sudo /etc/init.d/dhcp3-server restart
* Stopping DHCP server dhcpd3 [ OK ]
* Starting DHCP server dhcpd3 [ OK ]
ubuntu1@ubuntu1:~$
Jest jakaś możliwość ominięcia tego serwera dhcp z VB'a aby komputery ubuntu2 i ubuntu3 otrzymywały adresy w tej sieci co jest podana w konfiguracji dhcp w ubuntu1 ?
W syslogu ubuntu1 coś tam widzi komputer ubuntu2:
Kod: Zaznacz cały
ubuntu1@ubuntu1:~$ sudo tail -f /var/log/syslog | grep -i dhcp
Jan 12 23:31:36 ubuntu1 dhclient: DHCPREQUEST of 192.168.1.102 on eth0 to 192.168.1.1 port 67
Jan 12 23:31:36 ubuntu1 dhclient: DHCPACK of 192.168.1.102 from 192.168.1.1
Jan 12 23:34:58 ubuntu1 dhcpd: Wrote 0 leases to leases file.
Jan 12 23:42:06 ubuntu1 dhcpd: DHCPDISCOVER from 08:00:27:5a:be:e3 via eth1
Jan 12 23:42:06 ubuntu1 dhcpd: DHCPREQUEST for 192.168.56.102 (192.168.56.100) from 08:00:27:5a:be:e3 via eth1: ignored (not authoritative).
Jan 12 23:42:07 ubuntu1 dhcpd: DHCPOFFER on 192.168.0.2 to 08:00:27:5a:be:e3 (ubuntu2) via eth1
Kod: Zaznacz cały
ubuntu1@ubuntu1:~$ sudo dhclient eth1
Kod: Zaznacz cały
ubuntu1@ubuntu1:~$ sudo dhclient eth1
There is already a pid file /var/run/dhclient.pid with pid 5982
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth1/08:00:27:17:6b:0c
Sending on LPF/eth1/08:00:27:17:6b:0c
Sending on Socket/fallback
DHCPREQUEST of 192.168.56.101 on eth1 to 255.255.255.255 port 67
DHCPACK of 192.168.56.101 from 192.168.56.100
bound to 192.168.56.101 -- renewal in 1552 seconds.
ubuntu1@ubuntu1:~$
Macie pomysł jak stworzyć taką sieć aby VirtualBox nie mieszał w tym DHCP ?