LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Network sharing doesn't work more then a few seconds (https://www.linuxquestions.org/questions/debian-26/network-sharing-doesnt-work-more-then-a-few-seconds-172212/)

spiri 04-19-2004 05:00 PM

Network sharing doesn't work more then a few seconds
 
Hi,
I'm trying to share my Internet cable connection to the internal LAN (W2K),
I used several scripts the current one was made by firestarter.
My problem is:
if I surf the Internet in the server it's OK.
But if I surf from the workstations it works for 3~6 minutes and then the network comes down, I can't ping the server or the workstation.

After I stop the network and restart (network and firewall) it work the same way.

What is the possible problem.

Thank you in advance.

spiri

ToniT 04-19-2004 11:14 PM

Are you having dynamic ip address? Does running dhcp client again help?

spiri 04-20-2004 05:47 PM

No
 
Hi,
I have static IPs and no dhcp-client
try to install dhcp-client but it says can't find dhcp.conf

Do you think that I should use dinamic IP, my problem is samba.

Thank you.

ToniT 04-20-2004 08:51 PM

You have static ip also to internet?
How the samba is your problem? Wasn't the problem sharing the internet connection?

Do you have two nics or are you trying to do the thing within same wires?

spiri 04-22-2004 03:22 PM

You have static ip also to internet?
-No!
How the samba is your problem? Wasn't the problem sharing the internet connection?
-Yes, but if I start using dinamic IPs the serve can't find workstations, I think.

Do you have two nics or are you trying to do the thing within same wires?
-I had 2 nics: eth0 -> LAN; eth1->Internet.

Thanks.

spiri

ToniT 04-23-2004 07:59 PM

Hmm.. my first idea was that the dhcp-client is not running on the background and the ip-address expires, but it doesn't explain why the server stops pinging to the workstation.

It is also possible that the netcard just locks up for some reason. I have had this kind of lockup problem with some d-link cards using via-rhine driver and with somewhat old kernels (some 2.4.18 and older).

You could see the syslog and dmesg from the server if there are something netcard related (like "eth transmit timeout: reseting") problems. Also is it the firewall that hangs or the networking itsefl. That is, does the ping packets start transmiting again if you drop the firewall
Code:

iptables -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT

.

More questions: What kernel are you using? Does the packet counters increase after the hangup? Does there come some error, dropped or overruns when you look the interface with ifconfig?

spiri 04-24-2004 03:33 AM

Hi,
thank you for your help.

I remove the firestarter script, and use this one:




Code:

#!/bin/bash
modprobe ip_tables
modprobe iptable_filter
modprobe ip_conntrack
modprobe iptable_nat
modprobe ipt_MASQUERADE


iptables -F
iptables -X
iptables -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z

iptables -P INPUT ACCEPT
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A POSTROUTING -t nat -o eth1 -j MASQUERADE
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT


with this scrip it works more time, 2 or 3 minutes, and
the network is up so I can ping the workstations and the the nics are in the ifconfig.


Quote:

More questions: What kernel are you using? Does the packet counters increase after the hangup? Does there come some error, dropped or overruns when you look the interface with ifconfig?
linux 2.4.25-1-386 debian sarge

It could be a script problem or a hardware problem. I'm using a Gigabyte GA-7N400 Pro 2 with a r8139 module (eth1=internet) the lan nic is a US Robotics (tulip module->lan).
Maybe I had too change the nics ?

regards,

spiri

ToniT 04-24-2004 01:09 PM

Hmm.. does there come any errors for the interfaces?

For me there is one error package (happened at the initialization time when connecting the wires)
Code:

root@perhonen:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:FC:FE:7E:CB 
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20067217 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27068198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2356224898 (2.1 GiB)  TX bytes:0 (0.0 b)
          Interrupt:16 Base address:0xce00

eth1      Link encap:Ethernet  HWaddr 00:E0:81:10:4E:69 
          inet addr:***.***.***.****  Bcast:***.***.***.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8508261 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4470862 errors:1 dropped:0 overruns:0 carrier:1
          collisions:915806 txqueuelen:1000
          RX bytes:215281142 (205.3 MiB)  TX bytes:700039323 (667.6 MiB)
          Interrupt:19 Base address:0xee80 Memory:febfe000-febfe038

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:507085 errors:0 dropped:0 overruns:0 frame:0
          TX packets:507085 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:194418960 (185.4 MiB)  TX bytes:194418960 (185.4 MiB)

What are the last lines of dmesg?


Ok, now the machines ping eachother; does the network work afther few minutes from the server doing the routing? If not, is the dhcp-client still running?
(something like:
Code:

root      467    1  0 Apr09 ?        00:00:00 dhclient -pf /var/run/dhclient.eth1.pid eth1
.)

spiri 04-24-2004 02:25 PM

My ifconfig after it as broken the connection:
Code:

debian:/home/toto# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:C0:49:B3:59:F0
          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:1396 errors:0 dropped:65 overruns:0 frame:0
          TX packets:1731 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:186451 (182.0 KiB)  TX bytes:1618435 (1.5 MiB)
          Interrupt:5 Base address:0xa000
 
eth1      Link encap:Ethernet  HWaddr 00:0D:61:20:C5:F3
          inet addr:***.***.***.***  Bcast:***.***.***.***  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3713 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3034 errors:0 dropped:182 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2996708 (2.8 MiB)  TX bytes:0 (0.0 b)
          Interrupt:5 Base address:0x2000
 
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:171 errors:0 dropped:0 overruns:0 frame:0
          TX packets:171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:24011 (23.4 KiB)  TX bytes:24011 (23.4 KiB)
 
debian:/home/toto# ping 192.168.0.6
PING 192.168.0.6 (192.168.0.6) 56(84) bytes of data.
 
--- 192.168.0.6 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2015ms

last lines of dmesg
Code:

debian:/home/toto# tail /var/log/dmesg
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
hub.c: new USB device 00:02.2-5, assigned address 2
usb.c: USB device 2 (vend/prod 0xf5f/0x1320) is not claimed by any active driver.
hub.c: new USB device 00:02.1-3, assigned address 2
ip_conntrack version 2.1 (4095 buckets, 32760 max) - 292 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
usb_control/bulk_msg: timeout
usb-ohci.c: unlink URB timeout
usb.c: USB device not accepting new address=2 (error=-110)
hub.c: new USB device 00:02.1-3, assigned address 3

the network stops running and the dhcp-client is running.

I had to stop the network start it and run the iptables script to acces the internet from the server.

thank you

regards
spiri

spiri 04-28-2004 06:01 PM

Someone send this post to debian-firewall@lists.debian.org

Quote:

>These two problems look the same to me and I have/had a third. Dose any one know if these issues were resolved and if there is a problem with

Debian's or Linux's iptables? I'm thinking something in a recent

update,

two weekes past, has caused this. Many other ppl may be effected but

are

unaware or not using iptables.

This should be a BIG RED FLAG!!!


All times are GMT -5. The time now is 06:56 PM.