LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-06-2012, 09:04 PM   #1
5883
Member
 
Registered: Aug 2004
Posts: 36

Rep: Reputation: 0
How to change routing info from kernel code ?


i'm new to kernel, so this question is dummy.

but how to change default gateway inside kernel code,
e.g. my network device driver ?

thanks !
 
Old 02-07-2012, 12:02 PM   #2
theNbomr
Senior Member
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 4,506

Rep: Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602
You probably don't want to modify the kernel itself, but merely use the route command to modify the runtime routing behavior.
Code:
man route
If you really mean to modify the kernel, then my best suggestion is to dig into the kernel sources. <your-kernel>/net/ipv4/route.c looks like a good place to start.

--- rod.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source code for routing in Ad-Hoc networks imagine_me2 Linux - Networking 1 03-17-2011 03:51 PM
Adding custom info to TCP Header Options by changing Kernel Source code abhishek@LQ Linux - Networking 0 08-28-2010 07:44 AM
Hi i want info on I2c driver code structure avyadavnitw Linux - Embedded 1 05-10-2009 07:47 PM
how to parse info from a txt file using c++ code abhisheknayak Programming 8 11-23-2007 01:33 AM
User-Space Routing Info cophy Linux - Networking 1 07-23-2005 10:35 AM


All times are GMT -5. The time now is 03:22 PM.

Main Menu
 
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
Open Source Consulting | Domain Registration