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 03-23-2012, 10:01 AM   #1
alftavay
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
basic routing commands


Hi everybody

My route -n and ifconfig look like this right now. Letter characters in place of numeric digits below are for privacy.

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.11.ac.0 0.0.0.0 255.255.252.0 U 1 0 0 eth0
1de.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 10.11.ab.254 0.0.0.0 UG 0 0 0 eth0

ifconfig eth0
eth0 Link encap:Ethernet HWaddr ...
inet addr:10.11.72.68 Bcast:10.11.ab.255 Mask:255.255.252.0

What commands can i enter to make a route to host 192.168.fef.ghi?

Thanks ...
 
Old 03-23-2012, 10:08 AM   #2
nikmit
Member
 
Registered: May 2011
Location: Nottingham, UK
Distribution: Debian
Posts: 178

Rep: Reputation: 34
ip route add x.x.x.x via y.y.y.y
or
ip route add x.x.x.a/bb via y.y.y.y, where 'a' is the subnet address and 'bb' the prefix length - most commonly equal to '0/24'

you might also have to do 'ip route flush cache' after adding the route to activate it.
 
Old 03-23-2012, 10:47 AM   #3
alftavay
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks. So in my case it would be
ip route add 192.168.fef.ghi via y.y.y.y
or
ip route add 192.168.fef.0/24 via y.y.y.y
But how do i figure out y.y.y.y? ...
 
Old 03-23-2012, 10:51 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you don't "figure it out", you either know, or you ask someone who knows your network better than you do. It's an arbitrary device on YOUR network, so we can't tell you that.
 
  


Reply

Tags
route



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
routing issue - basic elemental09 Linux - Networking 2 04-01-2011 07:26 PM
Basic routing help Firebar Linux - Networking 4 05-11-2007 07:27 AM
Basic Routing broadband Linux - Networking 9 09-07-2004 12:44 AM
Basic routing pcrs Linux - Networking 1 10-07-2002 09:25 AM
Basic routing john.martelli Linux - Networking 3 03-25-2002 01:41 AM

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

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