[+] Drugi Interfejs sieciowy w DHCP

Masz problemy z siecią bądź internetem? Zapytaj tu
Pablik
Posty: 78
Rejestracja: 12 października 2010, 15:26

[+] Drugi Interfejs sieciowy w DHCP

Post autor: Pablik »

Witam.
Przedstawiam moje działające ustawienia.

/etc/network/interfaces

Kod: Zaznacz cały

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 83.19.28.220
        netmask 255.255.255.248
        gateway 83.19.28.217
        network 83.19.28.0
        broadcast 83.19.28.255

auto eth1
iface eth1 inet static
        address 10.0.0.1
        netmask 255.0.0.0

auto eth2
iface eth2 inet static
        address 10.0.0.2
        netmask 255.0.0.0
/etc/default/dhcp3-server

Kod: Zaznacz cały

# 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="eth1"
/etc/dhcp3/dhcpd.conf

Kod: Zaznacz cały

ddns-update-style none;
option domain-name-servers 194.204.159.1, 194.204.152.34;
default-lease-time 600;
max-lease-time 7200;

subnet 10.0.0.0 netmask 255.0.0.0 {
                option subnet-mask 255.0.0.0;
                option routers 10.0.0.1;
                option broadcast-address 10.0.0.255;


        ignore unknown-clients;

        #Admin
        host Ja {
                hardware ethernet 00:30:4F:79:9A:03;
                fixed-address 10.0.0.3;
        }

        #Olga
        host P102_1 {
                hardware ethernet 00:03:0D:84:30:6A;
                fixed-address 10.1.2.1;
        }
        i tam lista hostow
}

Chcę ustawić DHCP na drugim interfejsie lecz coś te ustawienia nie działają

/etc/network/interfaces

Kod: Zaznacz cały

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 83.19.28.220
        netmask 255.255.255.248
        gateway 83.19.28.217
        network 83.19.28.0
        broadcast 83.19.28.255

auto eth1
iface eth1 inet static
        address 10.0.0.1
        netmask 255.0.0.0

auto eth2
iface eth2 inet static
        address 10.0.0.2
        netmask 255.0.0.0
/etc/default/dhcp3-server

Kod: Zaznacz cały

# 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="eth1 eth2"
/etc/dhcp3/dhcpd.conf

Kod: Zaznacz cały

ddns-update-style none;
option domain-name-servers 194.204.159.1, 194.204.152.34;
default-lease-time 600;
max-lease-time 7200;

subnet 10.0.0.0 netmask 255.0.0.0 {
                option subnet-mask 255.0.0.0;
                option routers 10.0.0.1;
                option broadcast-address 10.0.0.255;


        ignore unknown-clients;

        #Admin
        host Ja {
                hardware ethernet 00:30:4F:79:9A:03;
                fixed-address 10.0.0.3;
        }

        #Olga
        host P102_1 {
                hardware ethernet 00:03:0D:84:30:6A;
                fixed-address 10.1.2.1;
        }
        i tam lista hostow
}

subnet 10.0.0.0 netmask 255.0.0.0 {
                option subnet-mask 255.0.0.0;
                option routers 10.0.0.2;
                option broadcast-address 10.0.0.255;


        ignore unknown-clients;

        #Ola
        host P111_1 {
                hardware ethernet 02:03:0D:85:31:7A;
                fixed-address 10.1.11.1;
        }
}
Może mi ktoś powiedzieć co robię źle?
Wiem, że "subnet 10.0.0.0 netmask 255.0.0.0" są takie same dla obydwóch interfejsów ale o to mi chodzi.
Awatar użytkownika
lessmian2
Member
Posty: 1088
Rejestracja: 30 kwietnia 2008, 19:38
Lokalizacja: Kraków

Post autor: lessmian2 »

Pablik pisze:Wiem, że "subnet 10.0.0.0 netmask 255.0.0.0" są takie same dla obydwóch interfejsów ale o to mi chodzi.
No to źle Ci chodzi, bo to nie będzie działało tak jak tego oczekujesz. Co prawda nie domyślam się nawet co Ty tam wykombinowałeś, ale i tak to nie będzie działało tak jak tego oczekujesz. Po pierwsze, jeśli masz na dwóch interfejsach takie same podsieci, to skąd wiadomo którym interfejsem ma wyjść pakiet? Po drugie, skąd serwer DHCP ma wiedzieć która definicja (w sensie sekcja w pliku) podsieci jest "lepsiejsza" i według której ma przydzielać te adresy?

Może lepiej napisz co chcesz osiągnąć, a pewnie znajdzie się ktoś, kto Ci wskaże dobrą drogę ;)
Pablik
Posty: 78
Rejestracja: 12 października 2010, 15:26

Post autor: Pablik »

Dobrze, problem już rozwiązany, zrobiłem mostek pomiędzy tymi dwoma interfejsami eth1 i eth2, i dhcp ustawiłem na ten mostek i działa.
redgrist
Posty: 64
Rejestracja: 23 kwietnia 2010, 11:19
Lokalizacja: Trójmiasto

Post autor: redgrist »

Pablik pisze:Dobrze, problem już rozwiązany, zrobiłem mostek pomiędzy tymi dwoma interfejsami eth1 i eth2, i dhcp ustawiłem na ten mostek i działa.
Z ciekawości zapytam jak zrobiłeś ten mostek?
ODPOWIEDZ