- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Change default gateway permanently
Operating System - HP-UX
1823913
Members
3506
Online
109667
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
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
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
тАО07-16-2004 01:38 AM
тАО07-16-2004 01:38 AM
Change default gateway permanently
Hello everyone!
I want to change the default gateway, and for that, I use the script you can find below :
# delete it from netconf
route delete default 192.168.16.1 1
# add a new one
route add default 192.168.16.30 1
# change netconf file using a script
./changeKeys.sh /etc/rc.config.d/netconf ROUTE_GATEWAY[0] "192.168.16.30"
# stop
/sbin/init.d/net stop
# restart service
/sbin/init.d/net start
It doesn't work; the message I get is
ERROR: Failed to add route entry because its interface is not
yet initialized. May need to add this route entry with
a route commad after the interface is up :
add net default: gateway 192.168.16.30: Network is unreachable
I've read some message in this forum and it seems that it could be a subnet problem...
Here you can find my routing table.
[mc2]root:/# netstat -rnv
Routing tables
Dest/Netmask Gateway Flags Refs Interface Pmtu
127.0.0.1/255.255.255.255 127.0.0.1 UH 0 lo0 4136
192.168.254.12/255.255.255.255 192.168.254.12 UH 0 lan0 4136
192.168.16.52/255.255.255.255 192.168.16.52 UH 0 lan5000 4136
192.168.16.25/255.255.255.255 192.168.16.25 UH 0 lan5000:2 4136
192.168.16.30/255.255.255.255 192.168.16.30 UH 0 lan5000:3 4136
192.168.16.31/255.255.255.255 192.168.16.31 UH 0 lan5000:1 4136
192.168.16.0/255.255.255.0 192.168.16.52 U 5 lan5000 1500
192.168.16.0/255.255.255.0 192.168.16.30 U 5 lan5000:3 1500
192.168.16.0/255.255.255.0 192.168.16.25 U 5 lan5000:2 1500
192.168.16.0/255.255.255.0 192.168.16.31 U 5 lan5000:1 1500
192.168.254.0/255.255.255.0 192.168.254.12 U 2 lan0 1500
127.0.0.0/255.0.0.0 127.0.0.1 U 0 lo0 0
default/0.0.0.0 192.168.16.1 UG 0 lan5000 0
Rgds,
Olivier
I want to change the default gateway, and for that, I use the script you can find below :
# delete it from netconf
route delete default 192.168.16.1 1
# add a new one
route add default 192.168.16.30 1
# change netconf file using a script
./changeKeys.sh /etc/rc.config.d/netconf ROUTE_GATEWAY[0] "192.168.16.30"
# stop
/sbin/init.d/net stop
# restart service
/sbin/init.d/net start
It doesn't work; the message I get is
ERROR: Failed to add route entry because its interface is not
yet initialized. May need to add this route entry with
a route commad after the interface is up :
add net default: gateway 192.168.16.30: Network is unreachable
I've read some message in this forum and it seems that it could be a subnet problem...
Here you can find my routing table.
[mc2]root:/# netstat -rnv
Routing tables
Dest/Netmask Gateway Flags Refs Interface Pmtu
127.0.0.1/255.255.255.255 127.0.0.1 UH 0 lo0 4136
192.168.254.12/255.255.255.255 192.168.254.12 UH 0 lan0 4136
192.168.16.52/255.255.255.255 192.168.16.52 UH 0 lan5000 4136
192.168.16.25/255.255.255.255 192.168.16.25 UH 0 lan5000:2 4136
192.168.16.30/255.255.255.255 192.168.16.30 UH 0 lan5000:3 4136
192.168.16.31/255.255.255.255 192.168.16.31 UH 0 lan5000:1 4136
192.168.16.0/255.255.255.0 192.168.16.52 U 5 lan5000 1500
192.168.16.0/255.255.255.0 192.168.16.30 U 5 lan5000:3 1500
192.168.16.0/255.255.255.0 192.168.16.25 U 5 lan5000:2 1500
192.168.16.0/255.255.255.0 192.168.16.31 U 5 lan5000:1 1500
192.168.254.0/255.255.255.0 192.168.254.12 U 2 lan0 1500
127.0.0.0/255.0.0.0 127.0.0.1 U 0 lo0 0
default/0.0.0.0 192.168.16.1 UG 0 lan5000 0
Rgds,
Olivier
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2004 01:57 AM
тАО07-16-2004 01:57 AM
Re: Change default gateway permanently
Olivier,
you should run
ifconfig lan# unplumb
to bring the IP stack down on the card
after you do /sbin/init.d/net stop
and before net start
Regards,
Bernhard
you should run
ifconfig lan# unplumb
to bring the IP stack down on the card
after you do /sbin/init.d/net stop
and before net start
Regards,
Bernhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2004 01:58 AM
тАО07-16-2004 01:58 AM
Re: Change default gateway permanently
It would appear that the problem likely existed
for the old gateway address. Check that
the interface for lan5000:1 is setup by the
the time you are configuring the gateway.
If lan5000 is configured when the routing
tables are being configure you can set up a route to the gateway via its address and then
add the default route using the gateway.
for the old gateway address. Check that
the interface for lan5000:1 is setup by the
the time you are configuring the gateway.
If lan5000 is configured when the routing
tables are being configure you can set up a route to the gateway via its address and then
add the default route using the gateway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2004 05:22 AM
тАО07-16-2004 05:22 AM
Re: Change default gateway permanently
The gateway you are trying to use appears to be a virtual IP address on the HPUX. Normally you should use an IP which is NOT on the HPUX as the gateway (therefore the metric of 1 at the end of the route add command) unless you are trying to do Proxy Arp in which case you would need to set the metric to 0. (This will tell the box to arp for any address it needs and then hopefully your friendly neighborhood router will reply with its own MAC address and will then forward the packets for you. This only works if the router is set to do proxy arp and is a bit slower than the usual method.)
It's not clear what you are trying to do with the multiple instances of the same LAN and I suspect the HPUX is having the same problem.
Ron
It's not clear what you are trying to do with the multiple instances of the same LAN and I suspect the HPUX is having the same problem.
Ron
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
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP