LinuxQuestions.org
Register a domain and help support LQ
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, 11: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, 11: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, 11: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, 11:51 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 05:18 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration