What is the difference between 'networking restart' and 'ifup ethx'
Hi,
I had a D-Link 802.11g router and it connected to Internet. Other computers at my home can connected to Internet through an Ubuntu 8.04 Server squid3 box via the D-Link router. But, there is a headache : If the D-Link router restart, for go Internet again I must execute '/etc/init.d/networking restart'. At same time, the squid3 daemon workings fine. I don't know what's the exact problem at there and need any advice and help. Thanks. |
Re: What is the difference between 'networking restart' and 'ifup ethx'
When your wireless router gets restarted/power cycled, the connections on your computer also gets broken. By doing a "/etc/init.d/networking restart" you are basically re-establishing the wireless connections.
Your squid daemon will be accepting connections, but as long as the squid cannot access internet it wont be able to serve the clients. I guess this is what is happening with you. |
Yes, You are right suga_rray. But why is it now establishing the connection automatically? I don't know much about the Ubuntu 8.04, but if HolyJoe requires a automatic reconnect, he/she may run a cron job every minute checking the availablity of the router.
ping -c 3 192.168.0.1 -w 3 ; if [ $? != 0 ] ; then /etc/init.d/networking restart ; fi 192.168.0.1 is the router IP address. Hope this helps |
Quote:
Yes, I want to establish the Internet connection automatically. I can receive the replies from ping to the router, but I cannot connect to Internet and I must execute '/etc/init.d/networking restart' (does not need to restart the squid3) What's wrong? :mad: |
Quote:
Yes, But how can I establish the Internet connection automatically. |
You shouldn't need to - I reset my (home) router regularly. Ubuntu desktop, not Server mind you.
The only time I've needed to issue a network restart is when the driver hasn't loaded successfully. Always at startup, not later on though. |
Quote:
Thank you for your reply. I don't like execute '/etc/init.d/networking restart' all the time after the router restart/power cycled too :scratch: May be I should let my problem more clear, make some examples to emulate the situation: $sudo ifdown eth0 #eth0 is the public NIC of my Ubuntu 8.04 Server $sudo ifup eth0 after above commands has been executed, I can receive ping replies from the router except other outside URL such as www.ubuntu.com. Need your help to find the key of the headache, thank you. |
Hi there,
I think you have to check if your the default route is up after you do sudo ifup eth0. check it using route command. you should see some thing like default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 towards the end of the output. If it is not there issue the following command to set the default route. route add default gw 192.168.0.1 of-course 192.168.0.1 is you router IP address. cheers |
Quote:
Thank you for your help. After 'ifup eth0' the 'router -n' has the following output: Code:
Kernel IP routing table So, I think my Ubuntu box had connected to router successful. |
All times are GMT -5. The time now is 05:18 PM. |