HPE GreenLake Administration
- Community Home
 - >
 - Servers and Operating Systems
 - >
 - Operating Systems
 - >
 - Operating System - Linux
 - >
 - Which file to add route ?
 
Operating System - Linux
        1840137
        Members
    
    
        2257
        Online
    
    
        110161
        Solutions
    
Forums
        Categories
Company
Local Language
                
                  
                  back
                
        
                
        
                
        
                
        
        
        
                
        
                
        
        
        
                
        
              
              Forums
Discussions
Forums
- Data Protection and Retention
 - Entry Storage Systems
 - Legacy
 - Midrange and Enterprise Storage
 - Storage Networking
 - HPE Nimble Storage
 
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
                
                  
                  back
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
            
                
            
                
            
                
            
                
            
            
                
            
                
            
            
                
            
                
              
            Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
 - Appliance Servers
 - Alpha Servers
 - BackOffice Products
 - Internet Products
 - HPE 9000 and HPE e3000 Servers
 - Networking
 - Netservers
 - Secure OS Software for Linux
 - Server Management (Insight Manager 7)
 - Windows Server 2003
 - Operating System - Tru64 Unix
 - ProLiant Deployment and Provisioning
 - Linux-Based Community / Regional
 - Microsoft System Center Integration
 
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
        Information
        Community
Resources
Community Language
        Language
        Forums
Blogs
	
		
			
            
                
            Go to solution
        
            
		
		
			
            	
	
		
        
		
	
	
		Topic Options
			
				
					
	
			
		
	- Subscribe to RSS Feed
 - Mark Topic as New
 - Mark Topic as Read
 - Float this Topic for Current User
 - Bookmark
 - Subscribe
 - Printer Friendly Page
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
08-14-2002 11:53 PM
08-14-2002 11:53 PM
			
				
					
					
						Hi
Which file should I modify to add a route to the system even though the linux machine has rebooted and the route still exist ?
Regards,
Patrick
	
			
				
		
			
			
			
			
			
			
		
		
		
	
	
	
Which file should I modify to add a route to the system even though the linux machine has rebooted and the route still exist ?
Regards,
Patrick
Solved! Go to Solution.
		2 REPLIES 2
	
	            
            
		
		
			
            
                - Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
08-15-2002 04:38 AM
08-15-2002 04:38 AM
Solution
			
				
					
					
						Patrick,
I'll assume you have Red hat Linux or similar based distro. The file you want to edit to add a permanent route is /etc/sysconfig/static-routes. Also to add / remove a route on the fly for a host
route add -host 10.10.10.45 gw 192.168.0.1
route del -host 10.10.10.45 gw 192.168.0.1
To Add / Remove a network
route add -net 10.10.10.0/24 gw 192.168.0.1
route del -net 10.10.10.0/24 gw 192.168.0.1
To add / remove a default gateway
route add default gw 192.168.0.1
route del default gw 192.168.0.1
Also as always netstat -rn to check current routing table. I hope I covered all the bases for you if this helps please don't forget the points.
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
		
		
	
	
	
I'll assume you have Red hat Linux or similar based distro. The file you want to edit to add a permanent route is /etc/sysconfig/static-routes. Also to add / remove a route on the fly for a host
route add -host 10.10.10.45 gw 192.168.0.1
route del -host 10.10.10.45 gw 192.168.0.1
To Add / Remove a network
route add -net 10.10.10.0/24 gw 192.168.0.1
route del -net 10.10.10.0/24 gw 192.168.0.1
To add / remove a default gateway
route add default gw 192.168.0.1
route del default gw 192.168.0.1
Also as always netstat -rn to check current routing table. I hope I covered all the bases for you if this helps please don't forget the points.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
08-15-2002 08:40 PM
08-15-2002 08:40 PM
			
				
					
						
							Re: Which file to add route ?
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Hi,
you can add the following two lines to the file "/etc/sysconfig/static-routes":
eth0 net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1
eth1 net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.2
In this Example
network number - 192.168.2.0
network mask - 255.255.255.0
gateway - 192.168.2.1
regards,
U.SivaKumar
					
				
			
			
				
		
		
	
	
	
you can add the following two lines to the file "/etc/sysconfig/static-routes":
eth0 net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1
eth1 net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.2
In this Example
network number - 192.168.2.0
network mask - 255.255.255.0
gateway - 192.168.2.1
regards,
U.SivaKumar
	Innovations are made when conventions are broken
			
			
				
			
			
			
			
			
			
		The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
		
	
	
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP