LinuxQuestions.org
Review your favorite Linux distribution.
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 08-24-2004, 09:08 AM   #1
hdalle
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Rep: Reputation: 0
Windows route configuration easier than Linux???


Hi Guys

I need to configure an ethernet interface, say 'eth0', and give it an IP of 10.1.1.19 with netmask 255.255.255.0

BUT

I need to set the default gw as 192.168.0.1

Whenever I do this with the 'route add default gw 192.168.0.1' command, it fails with:

SIOCADDRT: network is unreachable

I guess it only accepts default gateways that are similar, i.e. 10.1.1.X

In Windows this is straight forward; I just simply use the LAN properties window and play around with the TCP/IP properties to manually set the IP and gateway to whatever values I please and this works smoothly. Here's the output from windows:

===========================================================================

Active Routes:

Network Destination Netmask Gateway Interface Metric

0.0.0.0 0.0.0.0 192.168.0.1 10.1.1.19 20

10.1.0.0 255.255.0.0 10.1.1.19 10.1.1.19 20

10.1.1.19 255.255.255.255 127.0.0.1 127.0.0.1 20

10.255.255.255 255.255.255.255 10.1.1.19 10.1.1.19 20

127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1

224.0.0.0 240.0.0.0 10.1.1.19 10.1.1.19 20

255.255.255.255 255.255.255.255 10.1.1.19 10.1.1.19 1

Default Gateway: 192.168.0.1






Connection-specific DNS Suffix . :

IP Address. . . . . . . . . . . . : 10.1.1.19

Subnet Mask . . . . . . . . . . . : 255.255.0.0

Default Gateway . . . . . . . . . : 192.168.0.1



There must be a trick to do so in Linux/Unix that i just can't figure out.


Hisham
 
Old 08-24-2004, 09:11 AM   #2
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
Code:
route add 192.168.0.0 0.0.255.255 int eth0
 
Old 08-24-2004, 04:32 PM   #3
hdalle
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks PenguinPwrdBox for the fast response.

Are you sure though of the exact syntax for that command. I tried running it but it failed, prompting me with the usage.

Furthermore, what does this command really do?

Hisham
 
Old 08-24-2004, 05:17 PM   #4
arno
Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: fedora core 8, suse 10.3, ubuntu 7.10, kamikaze 7.09
Posts: 515

Rep: Reputation: 30
What you want is impossible !
With eth0 having 10.1.1.19 you can only acces a 10.1.1. network,
What you can do with routing is program the routing table for a certain network
route add -net 192.168.0.0 netmask 255.255.255.0 gw 10.1.1.1 ( every address starting with 192.168.0 is send to router 10.1.1.1 )
route add default gw 10.1.1.254 the rest is send to 10.1.1.254
 
Old 08-25-2004, 03:06 AM   #5
hdalle
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Original Poster
Rep: Reputation: 0
I don't think this is gonna work. I need the default route to be sent to the gateway 192.168.0.1

I can't believe how straight forward this is in Windows. Here's the output of the route table from the DOS prompt. Isn't there a way to replicate this table's characteristics with a few 'route add' commands in Linux?

====================================================

Active Routes:

Network Destination Netmask Gateway Interface Metric

0.0.0.0 0.0.0.0 192.168.0.1 10.1.1.19 20

10.1.0.0 255.255.0.0 10.1.1.19 10.1.1.19 20

10.1.1.19 255.255.255.255 127.0.0.1 127.0.0.1 20

10.255.255.255 255.255.255.255 10.1.1.19 10.1.1.19 20

127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1

224.0.0.0 240.0.0.0 10.1.1.19 10.1.1.19 20

255.255.255.255 255.255.255.255 10.1.1.19 10.1.1.19 1

Default Gateway: 192.168.0.1





Connection-specific DNS Suffix . :

IP Address. . . . . . . . . . . . : 10.1.1.19

Subnet Mask . . . . . . . . . . . : 255.255.0.0

Default Gateway . . . . . . . . . : 192.168.0.1
 
Old 08-25-2004, 06:14 AM   #6
arno
Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: fedora core 8, suse 10.3, ubuntu 7.10, kamikaze 7.09
Posts: 515

Rep: Reputation: 30
I have to tel you first that this a work around, you can do the following
first add an alias
ifconfig eth0:1 192.168.0.254
route add default gw 169.254.0.1
 
  


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
Is there an easier way to boot between Windows and Linux? zahadumy General 7 09-04-2005 05:33 PM
Is Linux really easier than Windows? tgreiner Linux - Newbie 19 03-01-2005 07:12 PM
For Linux GURU's: route configuration in complex network netguy2000 Linux - Networking 1 09-06-2004 09:00 AM
Oh how windows looks a whole lot easier!!! Help JDeer0618 Red Hat 6 10-25-2003 11:27 PM
Windows easier??? Copenhagen Cowboy Linux - Newbie 1 03-09-2001 04:29 PM

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

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