[+] udostepnianie internetu trzem komputerom poprzez most

Masz problemy z siecią bądź internetem? Zapytaj tu
mp_lasso
Posty: 4
Rejestracja: 31 lipca 2009, 01:02

[+] udostepnianie internetu trzem komputerom poprzez most

Post autor: mp_lasso »

Witam.
Mam problem z udostępnieniem internetu trzem komputerom. W komputerze posiadam 4 karty sieciowe: pierwsza (eth0) łączy się z internetem (UPC), a pozostałe (eth1, 2, 3) chcę by udostępniały internet pozostałym komputerom.
Posłużyłem się tym poradnikiem: http://forum.purepc.pl/Unix-and-Linux-a ... 3714.html# Zmieniłem eth1 na br0. Most wykonałem tymi komendami:

Kod: Zaznacz cały

apt-get install bridge-utils
brctl addbr br0
brctl addif br0 eth1
brctl addif br0 eth2
brctl addif br0 eth3
Według tego poradnika http://forum.ubuntu.pl/showthread.php?t=46783 skonfigurowałem /etc/network/interfaces:

Kod: Zaznacz cały

auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
   address 0.0.0.0

auto eth2
iface eth2 inet static
   address 0.0.0.0

auto eth3
iface eth3 inet static
   address 0.0.0.0

auto br0
iface br0 inet static
   address 192.168.0.1
   network 192.168.0.0
   netmask 255.255.255.0
   broadcast 192.168.0.255
   gateway 192.168.0.1
Plik /etc/default/dhcp3-server ustawiłem tak:

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="br0"
Problem polega na tym, że gdy chcę uruchomić dhcpd3 to wyskakuje następujący błąd:

Kod: Zaznacz cały

debian:~# dhcpd3 start
Internet Systems Consortium DHCP Server V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit [url]http://www.isc.org/sw/dhcp/[/url]
Wrote 1 leases to leases file.

No subnet declaration for start (0.0.0.0).
** Ignoring requests on start.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface start is attached. **


Not configured to listen on any interfaces!
A ponad to gdy stworzę wyżej wymieniony most to po restarcie już go nie ma.
Do tego w ifconfig niestety jest tylko eth0 i lo.
Awatar użytkownika
wojciech_69
Beginner
Posty: 128
Rejestracja: 02 stycznia 2009, 16:04

Post autor: wojciech_69 »

Według mnie poradniki, z których korzystałeś nie do końca jasno opisują udostępnianie internetu. Sam ostatnio borykałem się z tym problemem w domowej sieci i pomógł mi ten poradnik:
http://dug.net.pl/texty/masq.php

Ps. Jeżeli nie wykrywa Ci pozostałych sieciówek to znak, że możesz nie mieć ich załadowanych (ich sterowników lub obsługujących je modułów) bądź podniesionych.
mariaczi
Member
Posty: 1343
Rejestracja: 08 lutego 2008, 12:58
Lokalizacja: localhost@śląskie

Post autor: mariaczi »

Wszystko powolutku a będzie dobrze :)

Ustawiłeś tylko, że DHCP ma nasłuchiwać na br0. Nie skonfigurowałeś samego DHCP w:

Kod: Zaznacz cały

\etc\dhcp3\dhcpd.conf
Na szybko Google mi znalazło taki link Artykuł co prawda dotyczy starego poczciwego Woody, jednak wygląd pliku dhcpd.conf się nie zmienił (radykalnie). Skup się na sekcji "Konfiguracja".
Aby most zestawiał Ci się automatycznie przy uruchamianiu musisz utworzyć skrypt i dodać go do init.d (oraz odpowiednich runleveli) bądź skorzystać z dobrodziejstwa polecenia pre-up w interfaces. Pomocne będzie Ci

Kod: Zaznacz cały

man interfaces
mp_lasso
Posty: 4
Rejestracja: 31 lipca 2009, 01:02

Post autor: mp_lasso »

Jak napisałęm wyżej skorzystałem z poradnika, czyli mn. skonfigurowałem wg niego plik /etc/dhcp3/dhcpd.conf w ten sposób:

Kod: Zaznacz cały

authoritative;
ddns-update-style none;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.249;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
option subnet-mask 255.255.255.0;
}
fnmirk
Senior Member
Posty: 8324
Rejestracja: 03 grudnia 2007, 06:37

Post autor: fnmirk »

mp_lasso
Posty: 4
Rejestracja: 31 lipca 2009, 01:02

Post autor: mp_lasso »

fnmirk, wolałbym jednak użyć mostka sieciowego.

Edycja:
Wreszcie działa.
Aby zaczęło działać zmieniłem plik /etc/network/interfaces w ten sposób:

Kod: Zaznacz cały

auto lo
iface lo inet loopback

pre-up ifconfig eth1 up
pre-up ifconfig eth2 up
pre-up ifconfig eth3 up
pre-up brctl addbr br0
pre-up brctl addif br0 eth1
pre-up brctl addif br0 eth2
pre-up brctl addif br0 eth3

allow-hotplug eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
   address 0.0.0.0

auto eth2
iface eth2 inet static
   address 0.0.0.0

auto eth3
iface eth3 inet static
   address 0.0.0.0

auto br0
iface br0 inet static
   address 192.168.0.1
   netmask 255.255.255.0
Dziękuję za pomoc.
Pozdrawiam.
ODPOWIEDZ