LinuxQuestions.org
Visit Jeremy's Blog.
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 01-08-2010, 07:38 AM   #1
Joydeep Bakshi
Member
 
Registered: May 2007
Distribution: debian
Posts: 62

Rep: Reputation: 15
default gateway on different subnet


Hello list and net gurus,

I am in a big confusion and searching an answer to calm down my mind.

I have my eth0 has following configuration

` ` `
IP 192.168.1.100
mask 255.255.255.0
gateway 192.168.1.1

` ` `

There is also another gateway 192.168.2.1 which provides a different ISP connection. Both the gateways are connected to same HUB. I have changed mask as 255.255.0.0 to access 192.168.2.1 and also set it as default gateway by route command. So now my configuration is

` ` `
IP 192.168.1.100
mask 255.255.0.0
gateway 192.168.2.1

` ` `

I can now access the net (through 192.168.2.1) as well as the PC under the subnet 192.168.2.0 as well as the PCs under 192.168.1.0 "route -n" shows that default gateway is now 192.168.2.1 Every thing is fine and I have the liberty to change the gateway as required. But a question in mind. Is there any wrong effect to set the mask as 255.255.0.0 ? Kindly explain a little.

Thanks
 
Old 01-08-2010, 07:58 AM   #2
tungvs
Member
 
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Rep: Reputation: 15
Nothing's wrong with your IP configuration. Netmask is used to determine which part of your IP address is network address. You can use whatever properly netmask you want.
 
Old 01-08-2010, 12:38 PM   #3
efuenteso
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Rep: Reputation: 1
Yes Im agree,

Basicly with netmask 255.255.0.0 you are including your 2 subnets mentioned 192.168.1.0 and 192.168.2.0.

nemask 255.255.0.0 (/16) applied at 192.168.1.0 would extend your subnet lan and include ip range 192.168.1.1 to 192.168.255.254.

Thats the reason you are able to reach gateway 192.168.2.1.

it would be "healt" to set your subnet options to your network desing, ask your network administrator for correct netmask.

Regards!
EFO
 
Old 01-09-2010, 02:17 AM   #4
Joydeep Bakshi
Member
 
Registered: May 2007
Distribution: debian
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks for all your replies and clarification. I can now continue with the settings.
 
  


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
PC obtaining different subnet and gateway raktri4u Linux - Networking 2 04-03-2009 03:21 PM
two gateway for one subnet bondoq Linux - Networking 12 05-14-2007 09:05 AM
Two NIC's on same subnet/gateway TBKDan Linux - Networking 4 04-06-2007 10:20 PM
How to connect to a gateway on a different subnet? anGeR Linux - Networking 1 04-09-2004 08:50 AM
Gateway on different subnet mikewelter Linux - Networking 2 12-17-2003 12:28 PM

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

All times are GMT -5. The time now is 03:50 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