LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-28-2010, 06:45 AM   #1
aarav2306
Member
 
Registered: Jan 2009
Posts: 55

Rep: Reputation: 15
Internet stops when LAN switch is switched ON


hi
My PC is connected to an ISP with IP 192.168.1.21 on eth0
Internet works perfectly
I have installed an additional LAN card and configured it as eth1 with IP of 192.168.0.1
When I connect this LAN card to a LAN switch which in turn is connected to 6 other PCs, the internet stops working.
As soon as I switch OFF the LAN switch, I am able to access internet.
The IP addresses of the other PCs are configured as 192.168.0.2 etc. with gateway as 192.168.0.1 and DNS as the ISP DNS.
I can ping 192.168.0.1 from the LAN but neither LAN nor the main PC can access net.
I was planning to Masquerade and NAT the other computers without using squid
My main PC runs on Ubuntu 9.04 and out of the 6PCs on LAN, 2 are on Windows XP, 1 on Ubuntu 10.4, 1 on Ubuntu 9.10 and 2 on Ubuntu 9.04
Regards
Aarav
 
Old 07-28-2010, 10:00 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,455

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
Explain to us how your internet connection and network are arranged, what protocol, router, etc.
It sounds like you have set up so you box has a choice between the internal network, or the internet. That's always going to end in tears. Can you connect the internet directly to the server?
 
Old 07-28-2010, 10:11 AM   #3
aarav2306
Member
 
Registered: Jan 2009
Posts: 55

Original Poster
Rep: Reputation: 15
hi
My setup is as follows
ISP - Modem(192.168.1.1) - Ubuntu desktop 9.04(external interface eth0 192.168.1.21 & internal interface eth1 192.168.0.1) - switch - LAN (comprising of Ubtuntu 9.04, 9.10, 10.4 & XP machines with IP 192.168.0.2 - 8 and gateway of 192.168.0.1)
I did NAT as per https://help.ubuntu.com/community/In...nectionSharing
This worked perfectly well 1 day
Next day onwards whenever the LAN switch is "ON" the main Ubuntu wudnt get internet and the internet connection would work only when the LAN switch is turned "OFF". Even if all the PCs in LAN were to be switched off, the main Ubuntu would behave similarly i.e. internet would work only when switch isn't connected to it or switched off.
regards
Aarav
 
Old 07-29-2010, 03:27 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,455

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
Quote:
Originally Posted by aarav2306 View Post
hi
My setup is as follows
ISP - Modem(192.168.1.1) - Ubuntu desktop 9.04(external interface eth0 192.168.1.21 & internal interface eth1 192.168.0.1) - switch - LAN (comprising of Ubtuntu 9.04, 9.10, 10.4 & XP machines with IP 192.168.0.2 - 8 and gateway of 192.168.0.1) Aarav
OK. Modem on 192.168.1.1 is doing dhcp? If it's on pppoe it's not inclined to change the external IP. I really don't like that all your network is 192.168.0.nn, whereas your internet is on 192.168.1.nn. I'd make mistakes with that sort of thing.

for the record, run(on box with the internet, & 192.168.1.1)
cat /proc/sys/net/ipv4/ip_forward
It will say 0 or 1. If it says 0, try
echo 1 > /proc/sys/net/ipv4/ip_forward, and put that in rc.local.
Then I would go for the laziest of options. On 192.168.1.1 & 192.168.1.21, make an entry in /etc/hosts describing the other. These are 'known hosts' that your box may try in it's search path. If that doesn't sort it, post resolv.conf files from 192.168.1.1 & 1.21
 
Old 07-29-2010, 05:54 AM   #5
aarav2306
Member
 
Registered: Jan 2009
Posts: 55

Original Poster
Rep: Reputation: 15
hi
cat /proc/sys/net/ipv4/ip_forward gives an output of 1
I had to disconnect this PC from the LAN to access internet and post this reply
If not 192.168.0.nn then which series should I go in for ?
Modem on 192.168.1.1 is doing dhcp
Kindly help
regards
Aarav
 
Old 07-31-2010, 02:11 AM   #6
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
Quote:
My PC is connected to an ISP with IP 192.168.1.21 on eth0
Internet works perfectly
I have installed an additional LAN card and configured it as eth1 with IP of 192.168.0.1
When I connect this LAN card to a LAN switch which in turn is connected to 6 other PCs, the internet stops working.
It seems like there is problem with the default gateway when you set up your LAN. Your machine default route should point to your ISP gateway with ip_forward=1 enabled in your machine for other LAN clients access the internet. It would be good if you can post the output of the following,

netstat -rn

--
Prasanta
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to share internet connection with Single LAN card shared over a switch!! anupamjamatia Linux - Networking 1 05-29-2008 07:28 AM
How to share internet connection with Single LAN card shared over a switch anupamjamatia Linux - Networking 1 05-29-2008 05:49 AM
Switched to KVm Switch, and now I can't Display jmorais Linux - Newbie 2 03-06-2007 02:39 PM
KVM Switch disables the mouse wheel when switched Pauli Linux - Hardware 1 12-23-2005 01:50 PM
My Redhat Box suddenly stops internet access LAN Ok..HELP backbone Linux - Networking 8 10-23-2003 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration