LinuxForum.Fans
Тема

Не идет раздача интернета в локальную сеть

Автор: lucefer 16 сообщений 7911 просмотров
#46933

Всем доброго времени суток!
Настроил раздачу интернета в локальную сеть через Mandriva free. Поставил и настроил прокси-сервер. Все необходимые настройки прописал как на локальной машине, так и на сервере. При такой же конфигурации на Alt Linux 4.1.1 все работало.
P.S. В настройках браузера на сервере задал выход через прокси, все идет.
P.P.S. Пинг с локальной машины на сервер не проходит. В чем может быть проблема?,

#47164

P.P.S. Пинг с локальной машины на сервер не проходит. В чем может быть проблема?,

Вот с этого и нужно начать. Почему не ходит пинг.
А с сервера на комп идут?

#47202

Для начала попробуй
iptables -L что даёт, а потом
iptables -A INPUT ACCEPT
iptables -A OUTPUT ACCEPT
iptables -A FORWARD ACCEPT

#47268

Как сеть организована? Может стоит фильтрация по ip или mас - адресам?
маска? шлюзы? ip-статический?

маршруты? что выводит route?



Если нет пинга проблема или в фаерволе или в сети. Для начала можно отключить фаервол.



Отключить на обоих компьютерах.

#47326

Я раздачу интернета делал без прокси сервера. Не нужно это дома. :)

Чтоб проходил пинг, в фаерволе нужно снять галочку с пинга. после будет работать.

#47565
sbin написал:

А с сервера на комп идут?

С сервера на комп пинги идут.

kisil написал:
Для начала попробуй
iptables -L что даёт, а потом
iptables -A INPUT ACCEPT
iptables -A OUTPUT ACCEPT
iptables -A FORWARD ACCEPT

iptables -L

text

Chain INPUT (policy DROP)                                                
target     prot opt source               destination                     
Ifw        all  --  anywhere             anywhere                        
dynamic    all  --  anywhere             anywhere            state INVALID,NEW 
net2fw     all  --  anywhere             anywhere                              
net2fw     all  --  anywhere             anywhere                              
net2fw     all  --  anywhere             anywhere                              
net2fw     all  --  anywhere             anywhere                              
ACCEPT     all  --  anywhere             anywhere                              
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED                                                                          
Reject     all  --  anywhere             anywhere                               
LOG        all  --  anywhere             anywhere            LOG level info prefix `Shorewall:INPUT:REJECT:'                                                    
reject     all  --  anywhere             anywhere            [goto]             

Chain FORWARD (policy DROP) target prot opt source destination dynamic all -- anywhere anywhere state INVALID,NEW ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED Reject all -- anywhere anywhere LOG all -- anywhere anywhere LOG level info prefix `Shorewall:FORWARD:REJECT:' reject all -- anywhere anywhere [goto]

Chain OUTPUT (policy DROP) target prot opt source destination fw2net all -- anywhere anywhere fw2net all -- anywhere anywhere fw2net all -- anywhere anywhere fw2net all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED Reject all -- anywhere anywhere LOG all -- anywhere anywhere LOG level info prefix `Shorewall:OUTPUT:REJECT:' reject all -- anywhere anywhere [goto]

Chain Drop (1 references) target prot opt source destination all -- anywhere anywhere reject tcp -- anywhere anywhere tcp dpt:auth /* Auth */ dropBcast all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp fragmentation-needed /* Needed ICMP types */ ACCEPT icmp -- anywhere anywhere icmp time-exceeded /* Needed ICMP types */ dropInvalid all -- anywhere anywhere DROP udp -- anywhere anywhere multiport dports 135,microsoft-ds /* SMB */ DROP udp -- anywhere anywhere udp dpts:netbios-ns:netbios-ssn /* SMB */ DROP udp -- anywhere anywhere udp spt:netbios-ns dpts:1024:65535 /* SMB */ DROP tcp -- anywhere anywhere multiport dports 135,netbios-ssn,microsoft-ds /* SMB */ DROP udp -- anywhere anywhere udp dpt:1900 /* UPnP */ dropNotSyn tcp -- anywhere anywhere DROP udp -- anywhere anywhere udp spt:domain /* Late DNS Replies */

Chain Ifw (1 references) target prot opt source destination RETURN all -- anywhere anywhere match-set ifw_wl src DROP all -- anywhere anywhere match-set ifw_bl src IFWLOG all -- anywhere anywhere state INVALID,NEW psd weight-threshold: 10 delay-threshold: 10000 lo-ports-weight: 2 hi-ports-weight: 1 IFWLOG prefix 'SCAN'

Chain Reject (3 references) target prot opt source destination all -- anywhere anywhere reject tcp -- anywhere anywhere tcp dpt:auth /* Auth */ dropBcast all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp fragmentation-needed /* Needed ICMP types */ ACCEPT icmp -- anywhere anywhere icmp time-exceeded /* Needed ICMP types */ dropInvalid all -- anywhere anywhere reject udp -- anywhere anywhere multiport dports 135,microsoft-ds /* SMB */ reject udp -- anywhere anywhere udp dpts:netbios-ns:netbios-ssn /* SMB */ reject udp -- anywhere anywhere udp spt:netbios-ns dpts:1024:65535 /* SMB */ reject tcp -- anywhere anywhere multiport dports 135,netbios-ssn,microsoft-ds /* SMB */ DROP udp -- anywhere anywhere udp dpt:1900 /* UPnP */ dropNotSyn tcp -- anywhere anywhere DROP udp -- anywhere anywhere udp spt:domain /* Late DNS Replies */

Chain dropBcast (2 references) target prot opt source destination DROP all -- anywhere anywhere ADDRTYPE match dst-type BROADCAST DROP all -- anywhere BASE-ADDRESS.MCAST.NET/4

Chain dropInvalid (2 references) target prot opt source destination DROP all -- anywhere anywhere state INVALID

Chain dropNotSyn (2 references) target prot opt source destination DROP tcp -- anywhere anywhere tcp flags:!FIN,SYN,RST,ACK/SYN

Chain dynamic (2 references) target prot opt source destination

Chain fw2net (4 references) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere

Chain logdrop (0 references) target prot opt source destination DROP all -- anywhere anywhere

Chain logreject (0 references) target prot opt source destination reject all -- anywhere anywhere

Chain net2fw (4 references) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED Drop all -- anywhere anywhere LOG all -- anywhere anywhere LOG level info prefix `Shorewall:net2fw:DROP:' DROP all -- anywhere anywhere

Chain reject (10 references) target prot opt source destination DROP all -- anywhere anywhere ADDRTYPE match src-type BROADCAST DROP all -- BASE-ADDRESS.MCAST.NET/4 anywhere DROP igmp -- anywhere anywhere REJECT tcp -- anywhere anywhere reject-with tcp-reset REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain shorewall (0 references) target prot opt source destination

Chain smurfs (0 references) target prot opt source destination RETURN all -- default anywhere LOG all -- anywhere anywhere ADDRTYPE match src-type BROADCAST LOG level info prefix `Shorewall:smurfs:DROP:' DROP all -- anywhere anywhere ADDRTYPE match src-type BROADCAST LOG all -- BASE-ADDRESS.MCAST.NET/4 anywhere LOG level info prefix `Shorewall:smurfs:DROP:' DROP all -- BASE-ADDRESS.MCAST.NET/4 anywhere

iptables -A INPUT ACCEPT

text
Bad argument `ACCEPT'
Try `iptables -h' or 'iptables --help' for more information.
AlexNik написал:
Как сеть организована? Может стоит фильтрация по ip или mас - адресам?
маска? шлюзы? ip-статический?
маршруты? что выводит route?
Если нет пинга проблема или в фаерволе или в сети. Для начала можно отключить фаервол.
Отключить на обоих компьютерах.

Никакой фильтрации я не ставил еще. Все IP статические и прописаны как положено.

route

text
Kernel IP routing table
Destination     Gateway         Genmask             Flags Metric Ref    Use Iface
10.56.27.160    *                 255.255.255.224  U     5      0        0 eth1
192.168.1.0      *                 255.255.255.0      U     5      0        0 eth0
link-local            *                 255.255.0.0          U     5      0        0 eth0
link-local            *                 255.255.0.0           U     5      0        0 eth1
default         10.56.27.161     0.0.0.0                UG    5      0        0 eth1
#47572

Больно сильно у тебя файрвол настроен. Ты его сам настраивал? Если да то открой порт на каком весит прокся. С вывода iptables я понял что у тебя всё закрыто.

#47614
kisil написал:
Больно сильно у тебя файрвол настроен. Ты его сам настраивал? Если да то открой порт на каком весит прокся. С вывода iptables я понял что у тебя всё закрыто.

Файрвол вообще не настраивал и не трогал. Но то, что порты закрыты понял сразу. У iptables есть вообще конфигурационный файл, чтобы его открыть и настроить файрвол?

#48770
sbin написал:
Зачем его конфиг??? Создай свой скрипт с правилами и запускай его при старте и там открывай порты.
Вот документация:
http://www.opennet.ru/docs/RUS/iptables/
http://www.iptables.ru/

Через конфиг для меня удобнее просто. Нашёл где лежит.
Создавал свои правила неоднократно. Не помогло. Все порты закрыты все равно.
Вернулся обратно на ALt Linux. Сделал все те же настройки, все заработало. Интересная вещь однако :o.

#48922
lucefer написал:
[quote=sbin]Зачем его конфиг??? Создай свой скрипт с правилами и запускай его при старте и там открывай порты.
Вот документация:
http://www.opennet.ru/docs/RUS/iptables/
http://www.iptables.ru/

Через конфиг для меня удобнее просто. Нашёл где лежит.
Создавал свои правила неоднократно. Не помогло. Все порты закрыты все равно.
Вернулся обратно на ALt Linux. Сделал все те же настройки, все заработало. Интересная вещь однако :o.[/quote]
Покажите Ваши правила.

#49027

[console]
# iptables -A FORWARD -s 168.192.1.0/24 -i eth0 -j ACCEPT
# iptables -A FORWARD -d 168.192.1.0/24 -o eth0 -j ACCEPT
# iptables -A FORWARD -o eth0 -p tcp -j DROP
# iptables -A FORWARD -o eth1 -p tcp -j DROP
# iptables -t nat -A PREROUTING --dst 192.168.1.1 -p tcp --dport 3128 -j DNAT --to-destination 192.168.1.1:8081
[/console]

Это то, что стоит сейчас. Здесь eth0 - смотрит в локальную сеть, eth1 - смотрит в интернет.
Хотел воспользоваться ещё таким правилом
[console]
# iptables -A POSTROUTING -o eth1 -j SNAT --to-source 10.56.X.X
[/console]

но получил ошибку

[console]
# iptables: No chain/target/match by that name.
[/console]

#49041

И ещё вопросик про раздачу интернета по локалу. Две мандривы фри, сеть настроена и модем (usb от МТС) не конфликтует. Но вот как заставить модем отправить интернет и на вторую машинку, тут вопрос. Пробовал центре управления-сеть и интернет-совместное использование интернет соединения...но оно мне говорит: "В вашей системе не обнаружено ни одного настроенного для работы с локальной сетью сетевого адаптера." как это излечить и всё таки направить интернет не тока на первую машину, а на вторую.

#49042

С USB модемами не сталкивался, но думаю что по анологии.
Едиснтвенное, вместо eth0 нужно будет писать тот сетевой интерфейс который даёт модем.

#49196

Перечитав всю ту тему, так и не въехал...лог с рута, может кто подскажет как бороться

text
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.64     *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     10     0        0 eth0
link-local      *               255.255.0.0     U     10     0        0 eth0
default         *               0.0.0.0         U     0      0        0 ppp0
default         linux-2.local   0.0.0.0         UG    10     0        0 eth0
text
ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:25:22:22:39:95
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:457 errors:0 dropped:0 overruns:0 frame:0
          TX packets:936 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:54891 (53.6 KiB)  TX bytes:129999 (126.9 KiB)
          Interrupt:27 Base address:0xa000

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3856 errors:0 dropped:0 overruns:0 frame:0 TX packets:3856 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:215108 (210.0 KiB) TX bytes:215108 (210.0 KiB)

ppp0 Link encap:Point-to-Point Protocol inet addr:10.236.38.89 P-t-P:10.64.64.64 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:176 errors:0 dropped:0 overruns:0 frame:0 TX packets:194 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:82762 (80.8 KiB) TX bytes:30974 (30.2 KiB)

#49564
lucefer написал:
[console]
# iptables -A FORWARD -s 168.192.1.0/24 -i eth0 -j ACCEPT
# iptables -A FORWARD -d 168.192.1.0/24 -o eth0 -j ACCEPT
# iptables -A FORWARD -o eth0 -p tcp -j DROP
# iptables -A FORWARD -o eth1 -p tcp -j DROP
# iptables -t nat -A PREROUTING --dst 192.168.1.1 -p tcp --dport 3128 -j DNAT --to-destination 192.168.1.1:8081
[/console]

Это то, что стоит сейчас. Здесь eth0 - смотрит в локальную сеть, eth1 - смотрит в интернет.
Хотел воспользоваться ещё таким правилом
[console]
# iptables -A POSTROUTING -o eth1 -j SNAT --to-source 10.56.X.X
[/console]

но получил ошибку

[console]
# iptables: No chain/target/match by that name.
[/console]

Пробуй очистить, а потом разрешить все пока без всяких сквидов:
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j SNAT --to-source 10.56.27.160

Lamer_In_Linux написал:
Перечитав всю ту тему, так и не въехал...лог с рута, может кто подскажет как бороться
text
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.64     *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     10     0        0 eth0
link-local      *               255.255.0.0     U     10     0        0 eth0
default         *               0.0.0.0         U     0      0        0 ppp0
default         linux-2.local   0.0.0.0         UG    10     0        0 eth0
text
ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:25:22:22:39:95
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:457 errors:0 dropped:0 overruns:0 frame:0
          TX packets:936 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:54891 (53.6 KiB)  TX bytes:129999 (126.9 KiB)
          Interrupt:27 Base address:0xa000

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3856 errors:0 dropped:0 overruns:0 frame:0 TX packets:3856 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:215108 (210.0 KiB) TX bytes:215108 (210.0 KiB)

ppp0 Link encap:Point-to-Point Protocol inet addr:10.236.38.89 P-t-P:10.64.64.64 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:176 errors:0 dropped:0 overruns:0 frame:0 TX packets:194 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:82762 (80.8 KiB) TX bytes:30974 (30.2 KiB)

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Войдите или зарегистрируйтесь, чтобы ответить.