п.1. Установка через синаптик dhcp3-server. Отличие от мануалов в том, что в 11.10 файлы называются по другому.
/etc/dhcp/dhcpd.conf
#
# Sample configuration file for ISC dhcpd for Debian
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks...
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
#log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.10 192.168.1.40; interface eth0;}
# This is a very basic subnet declaration.
#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
option domain-name-servers 192.168.1.5;
# option domain-name "internal.example.org";
option routers 192.168.1.5;
option broadcast-address 192.168.1.0;
# default-lease-time 600;
# max-lease-time 7200;
#}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}
# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.
#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}
особое внимание на параметры сети:
subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.10 192.168.1.40; interface eth0;}
option domain-name-servers 192.168.1.5;
option routers 192.168.1.5;
option broadcast-address 192.168.1.0;
Параметры забиваются в ручную, в след. посте. eth0 сетевуха в локаль определяется по ifconfig.
Перезагрузка, проверяете поключив комп. к сети в автоматическом режиме должен получить параметры.
Пользователь решил продолжить мысль 07 Марта 2012, 13:05:01:
п.2. через синаптик устанавливаем wvdial удаляем Нетворк-манагер.
прописываем в конфиг: /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init5 = AT+CGDCONT=1,"IP","internet"
Abort on No Dialtone = off
Modem Type = Analog Modem
Stupid Mode = 1
Phone = *99***1#
ISDN = 0
Password = pass
Username = user
Modem = /dev/ttyUSB0
Baud = 230400
а чтоб он запускал соединение прописываем файл interfaces
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
auto ppp0
iface ppp0 inet wvdial
provider wvdial
за неделю наблюдений никаких обрывов не наблюдал работает с 8 до 8. надобности писать скрипт котролирующий соединение... не вижу.
Пользователь решил продолжить мысль 07 Марта 2012, 16:16:09:
п.3. NAT сработало со следующим материалом :
https://help.ubuntu.com/community/Internet/ConnectionSharingв файле /etc/sysctl.conf
раскоментировал строку #net.ipv4.ip_forward=1
net.ipv4.ip_forward=1
и в файл /etc/rc.local перед строкой "exit 0" добавил вот это:
sudo iptables -A FORWARD -o ppp0 -i eth0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
при подключении к енет по команде ifconfig у меня след устройство ppp0 смотрит в енет, eth0 - в локаль.
Перегружаемся.. работает.
Пользователь решил продолжить мысль 07 Марта 2012, 16:52:10:
п.4. DNS прокси.
При подключенном интернете смотрим файл /etc/resolv.conf в него автоматически прописываются ДНС выданные провайдером, записываем и храним.
Через синаптик удаляем dnsmasq и только потом ставим pdnsd на вопросы об настройке конфигурции - отвечаем вручную.
Правим фалы конфигурации:
/etc/default/pdnsd
# do we start pdnsd ?
START_DAEMON=yes
# auto-mode, overrides /etc/pdsnd.conf if set [see /usr/share/pdnsd/]
AUTO_MODE=
# optional CLI options to pass to pdnsd(
START_OPTIONS=
yes - запускает демон pdnsd
файл настройки pdnsd
global {
perm_cache = 2048;
cache_dir = "/var/cache/pdnsd";
run_as = "pdnsd";
server_ip = eth0; // Use eth0 here if you want to allow other
// machines on your network to query pdnsd.
status_ctl = on;
paranoid = on;
min_ttl = 15m; // Retain cached entries at least 15 minutes.
max_ttl = 1w; // One week.
timeout = 10; // Global timeout option (10 seconds).
}
server {
label = "mydns";
// root_server = on;
ip = x.x.x.x //адрес ДНС серверов провайдера см. выше
, x.x.x.x
, 8.8.8.8 // до кучи ДНС гугла
, 8.8.4.4
;
timeout = 5;
uptest = query;
interval = 30m; // Test every half hour.
ping_timeout = 300; // 30 seconds.
purge_cache = off;
exclude = .localdomain;
policy = included;
preset = off;
}
server {
label = "root-servers";
root_server = on;
ip = 198.41.0.4
, 192.228.79.201
, 192.33.4.12
, 128.8.10.90
, 192.203.230.10
, 192.5.5.241
, 192.112.36.4
, 128.63.2.53
/*
, 192.36.148.17
, 192.58.128.30
, 193.0.14.129
, 198.32.64.12
, 202.12.27.33
*/
;
timeout = 5;
uptest = query;
interval = 30m; // Test every half hour.
ping_timeout = 300; // 30 seconds.
purge_cache = off;
exclude = .localdomain;
policy = included;
preset = off;
}
source {
owner = localhost;
file = "/etc/hosts";
}
rr {
name = localhost;
reverse = on;
a = 127.0.0.1;
owner = localhost;
soa = localhost,root.localhost,42,86400,900,86400,86400;
}
внимание... server_ip = eth0; определяет pdns слушать все запросы которые приходят на сетевуху локальной сети. и позволяет компутерам в локали пользоваться pdnsd.
демон пднcд сам переписывает файл /etc/resolv.conf как то так!
Перезагружаемся. по ощущениям работает быстрее пропали паузы при повторном открытии страниц.
можно через терминал проверить работает ли демон sudo pdnsd-ctl status
проверить скорость отклика dig google.ru два раза наблюдая на время ответа.
Пользователь решил продолжить мысль 07 Марта 2012, 17:08:09:
А роутер купить не проще? или я не понял сути?
ВЫ про 3g роутер!?
я исходил из следующего:
- есть компутер для этого,
- уже есть модем 3g,
- экономика должна быть экономной,
- непредсказуемо как будет работать чтоб его покупать,
- нет у роутера ДНС прокси с возможностью сохранения КЭШ на винт.
- нет сквида.... какие никакие , но ускорители.
А суть в том,что выход есть.. дешево, сердито и не сложно!))