LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 02-06-2012, 09:04 PM   #1
5883
Member
 
Registered: Aug 2004
Posts: 173

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
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

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



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
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-26-2010 11:29 PM
Hi i want info on I2c driver code structure avyadavnitw Linux - Embedded & Single-board computer 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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:54 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
Open Source Consulting | Domain Registration