The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-09-2004
rhfrommn rhfrommn is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2003
Location: Minnesota
Posts: 424
You set your gateway in /etc/defaultrouter. Edit that file with the new IP you need.

To set the IP of the machine you change the entry in /etc/hosts for the hostname of the machine. Make sure /etc/hostname.hme0 (or whichever interface you are using) has the correct hostname in it.

Change both of those and reboot and you'll be all set. If you want to do it without rebooting, make those changes so it does come up correctly next time then do the following:

1. Use the route command to set your default route on the fly. It should be

route add default IP_OF_GATEWAY

but check man route to be sure you get the syntax right for what you're needing to do.

2. Use ifconfig to change the IP address of the interface on the fly. It should be

ifconfig hme0 down
ifconfig hme0 NEW_IP_ADDR
ifconfig hme0 up

Again, use the correct interface if you're not on hme0.

Good luck!

Ralph