- 论坛徽章:
- 0
|
如何改HP机的IP(使用命令行)?
Hi,
To permanently change your system IP:
1. vi /etc/rc.config.d/netconf
change the IP
If you have changed the gateway, netmask, etc. Also change those entries.
2. vi /etc/hosts
To change the IP in this file.
3. If you are allowed to reboot the system, do a \"shutdown -r 0\" now, since this will make sure your new settings are correct and will NOT give you or someone else any surprises in the future reboots. I highly recommend you to do this, if possible.
or
4. If you are not allowed to reboot and you are sure that your changes are correct (no syntax errors), then you can use ifconfig/route commands to change the IP (e.g. for lan3)
# ifconfig lan3 unplumb
# ifconfig lan3 <new-IP>; netmask <new-netmask>;
# route add default <new-gateway-IP>; 1 <- if lan3 is your primary lan
# route add net <new-IP>; <new-gateway-IP>; 1 <- if lan3 is not your primary lan
You are done!
Hope this helps. |
|