Fórum Ubuntu CZ/SK
Ubuntu pro osobní počítače => Internet a sítě => Téma založeno: dadam 16 Února 2010, 11:14:22
-
Zdravím. Mám problém s DHCP. K internetu se připojuji přes wlan0, a chtěl bych, aby na eth0 běželo DHCP. Všechno jsem nastavil, nicméně nic nefungovalo a ping mi psal 'Operation not permitted'. Zjistil jsem, že je to proto, že když připojím kabel, network-manager mi přepíše IP adresu (je nastavená staticky). Adresu jsem nastavil i v manageru a začalo to fungovat.
Nicméně po pár dnech, kdy jsem dhcp nepoužíval (nicméně nepoužíval ani eth0) mi to zase nefunguje, ping píše tu samou chybu a network-manager u drátové sítě píše, že 'Zařízení není spravováno'.
/etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
/etc/dhcp3/dhcpd.conf (zakomentované části jsem vynechal):
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.0 192.168.0.2;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
/etc/default/dhcp3-server:
INTERFACES="eth0"
-
Děkuju za odpověď. NM jsem smazal, místo něj si nainstaloval wicd. Všechno jsem to poupravoval, navíc ještě nastavil gateway na 192.168.0.100 (ať ten počítač aspoň existuje), nicméně chyba přetrvává. Zajímavé, že když pingnu 192.168.0.100, tak funguje. Výpis ifconfig eth0:
eth0 Link encap:Ethernet HWadr 00:1d:72:08:26:17
inet adr:192.168.0.100 Všesměr:192.168.0.255 Maska:255.255.255.0
inet6-adr: fe80::21d:72ff:fe08:2617/64 Rozsah:Linka
AKTIVOVÁNO VŠESMĚROVÉ_VYSÍLÁNÍ BĚŽÍ MULTICAST MTU:1500 Metrika:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
kolizí:0 délka odchozí fronty:1000
Přijato bajtů: 3188 (3.1 KB) Odesláno bajtů: 1940 (1.9 KB)
Přerušení:16
-
Tak problém 'vyřešen'.
adam@loki:~$ sudo iptables -A INPUT -j ACCEPT
adam@loki:~$ sudo iptables -A OUTPUT -j ACCEPT
Co naprosto nechápu je fakt, že předchozí dva příkazy už jsem prováděl, jen jsem úplně zapomněl že jsem něco takového dělal. To se iptables po každém restartu resetují?
-
Ahoj,
Také konfiguruji DHCP mám na ubuntu dvě lan karty ,,eth0,, a ,,eth1,, na eth0 mám připojený internet a ten mám přes ip tables forwardován na eth1 to funguje.
Ale na eth1 chci spustit dhcp server v nastavení ,,/etc/default/dhcp3-server jsem v interfaces nastavil eth1.
V ,,/etc/dhcp3/dhcpd.conf,, jsem nastavil následující:
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.5 192.168.0.15;
#option domain-name-servers 192.168.1.1
#option domain-name "T-MOBILE";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
dám restart vše je ok a server se spustí ve win mám přidělenou adresu 192.168.0.5 a bránu 192.168.1.1 ale v řádku server dhcp mám přidělenou ip 192.168.0.1 a nevím kde tuto adresu v dhcpd mám najít aby ji mohl změnit na 192.168.1.1
-
Popisujete to dost zmateně. Je vám jasné že v síti 192.168.0/24 žádná 192.168.1.x brána neexistuje?
dejte výpis ip aa výpis z win ipconfig /all
-
Zde je výpis z ipconfig:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:26:55:48:21:5c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
inet6 fe80::226:55ff:fe48:215c/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:b0:c2:03:62:5d brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0.255 scope global eth1
inet6 fe80::2b0:c2ff:fe03:625d/64 scope link
valid_lft forever preferred_lft forever
-
Dík moc všem za radu ale už mě to jede chyba byla v:
# option domain-name-servers ns1.internal.example.org;1. jsem ho měl # zakázán
2. jsem místo ,,ns1.internal.example.org" zadal platnou DNS adresu providera
A už to funguje přidělí adresu a internet jde taky
Jenom ještě dotaz můžu za tento středník v řádku ,, option domain-name-servers ns1.internal.example.org;" přidat ještě sekundární DNS adresu.
A druhý dotaz jak mám udělat aby se my tento dhcp server spuštěl automaticky po naběhnutí systému a já ho nemusel spouštět v terminálu pře přikaz ,,sudo /etc/init.d/dhcp3-server start"
-
nemusel spouštět v terminálu pře přikaz ,,sudo /etc/init.d/dhcp3-server start"
cest je více, ale mělo by postačit nejsnadnější řešení - dopsat příkaz před "exit 0" do souboru /etc/rc.local
-
Ahoj,
Tak jsem updatoval na ubuntu 10.04 a dhcp přestalo fungovat.
Mám dvě lan karty eth0 a eth1.
oth0 je připojena k internetu a eth1 je připojena do místní sítě dle návoda jsem forwardoval připojení
http://wiki.ubuntu.cz/Sd%C3%ADlen%C3%AD%20internetov%C3%A9ho%20p%C5%99ipojen%C3%ADdále jsem v /etc/default/dhcp3-server:
nastavil eth1
a takto nakonfiguroval dhcpd.conf
# A slightly different configuration for an internal subnet.
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.5 192.168.2.15;
option domain-name-servers 212.158.128.2;
# option domain-name "internal.example.org";
option routers 192.168.2.1;
option broadcast-address 192.168.2.255;
default-lease-time 600;
max-lease-time 7200;
}Bohužel když se pokusím server startovat tak fail
-
Zde přikládám výpis ze syslog:
May 4 15:54:14 filip-desktop AptDaemon: INFO: Initializing daemon
May 4 15:59:15 filip-desktop AptDaemon: INFO: Quiting due to inactivity
May 4 15:59:15 filip-desktop AptDaemon: INFO: Shutdown was requested
May 4 16:01:24 filip-desktop dhcpd: Wrote 0 leases to leases file.
May 4 16:01:24 filip-desktop dhcpd:
May 4 16:01:24 filip-desktop dhcpd: No subnet declaration for eth0 (192.168.1.4).
May 4 16:01:24 filip-desktop dhcpd: ** Ignoring requests on eth0. If this is not what
May 4 16:01:24 filip-desktop dhcpd: you want, please write a subnet declaration
May 4 16:01:24 filip-desktop dhcpd: in your dhcpd.conf file for the network segment
May 4 16:01:24 filip-desktop dhcpd: to which interface eth0 is attached. **
May 4 16:01:24 filip-desktop dhcpd:
May 4 16:01:24 filip-desktop dhcpd:
May 4 16:01:24 filip-desktop dhcpd: Not configured to listen on any interfaces!
May 4 16:01:51 filip-desktop dhcpd: Wrote 0 leases to leases file.
May 4 16:01:51 filip-desktop dhcpd:
May 4 16:01:51 filip-desktop dhcpd: No subnet declaration for eth1 (0.0.0.0).
May 4 16:01:51 filip-desktop dhcpd: ** Ignoring requests on eth1. If this is not what
May 4 16:01:51 filip-desktop dhcpd: you want, please write a subnet declaration
May 4 16:01:51 filip-desktop dhcpd: in your dhcpd.conf file for the network segment
May 4 16:01:51 filip-desktop dhcpd: to which interface eth1 is attached. **
May 4 16:01:51 filip-desktop dhcpd:
May 4 16:01:51 filip-desktop dhcpd:
May 4 16:01:51 filip-desktop dhcpd: Not configured to listen on any interfaces!
May 4 16:03:25 filip-desktop dhcpd: Wrote 0 leases to leases file.
May 4 16:03:25 filip-desktop dhcpd:
May 4 16:03:25 filip-desktop dhcpd: No subnet declaration for eth1 (0.0.0.0).
May 4 16:03:25 filip-desktop dhcpd: ** Ignoring requests on eth1. If this is not what
May 4 16:03:25 filip-desktop dhcpd: you want, please write a subnet declaration
May 4 16:03:25 filip-desktop dhcpd: in your dhcpd.conf file for the network segment
May 4 16:03:25 filip-desktop dhcpd: to which interface eth1 is attached. **
May 4 16:03:25 filip-desktop dhcpd:
May 4 16:03:25 filip-desktop dhcpd:
May 4 16:03:25 filip-desktop dhcpd: Not configured to listen on any interfaces!
May 4 16:03:40 filip-desktop dhcpd: Wrote 0 leases to leases file.
May 4 16:03:40 filip-desktop dhcpd:
May 4 16:03:40 filip-desktop dhcpd: No subnet declaration for eth1 (0.0.0.0).
May 4 16:03:40 filip-desktop dhcpd: ** Ignoring requests on eth1. If this is not what
May 4 16:03:40 filip-desktop dhcpd: you want, please write a subnet declaration
May 4 16:03:40 filip-desktop dhcpd: in your dhcpd.conf file for the network segment
May 4 16:03:40 filip-desktop dhcpd: to which interface eth1 is attached. **
May 4 16:03:40 filip-desktop dhcpd:
May 4 16:03:40 filip-desktop dhcpd:
May 4 16:03:40 filip-desktop dhcpd: Not configured to listen on any interfaces!
May 4 16:06:13 filip-desktop dhcpd: Wrote 0 leases to leases file.
May 4 16:06:13 filip-desktop dhcpd:
May 4 16:06:13 filip-desktop dhcpd: No subnet declaration for eth1 (0.0.0.0).
May 4 16:06:13 filip-desktop dhcpd: ** Ignoring requests on eth1. If this is not what
May 4 16:06:13 filip-desktop dhcpd: you want, please write a subnet declaration
May 4 16:06:13 filip-desktop dhcpd: in your dhcpd.conf file for the network segment
May 4 16:06:13 filip-desktop dhcpd: to which interface eth1 is attached. **
May 4 16:06:13 filip-desktop dhcpd:
May 4 16:06:13 filip-desktop dhcpd:
May 4 16:06:13 filip-desktop dhcpd: Not configured to listen on any interfaces!
-
/etc/network/interfaces