Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

changing IP from SSH

What is the command to change the IP from a ssh session?
ifconfig something?

Thanks

ps: this is on redhat 9
0
dissolved
Asked:
dissolved
  • 3
  • 2
1 Solution
 
rindiCommented:
Yes, it is ifconfig:

ifconfig eth0 xxx.xxx.xxx.xxx

you can get more info on ifconfig with man ifconfig or info ifconfig. You either have to be root to use ifconfig or use the full path, ie /sbin/ifconfig

Also be aware that if you change the IP of the interface you are connected to via SSH, you will loose the connection until you reconnect with the new IP.
0
 
dissolvedAuthor Commented:
thanks. how do I change the netmask and gateway?
0
 
rindiCommented:
To set the gateway:

route add default gw xxx.xxx.xxx.xxx

to set the netmask:

ifconfig eth0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx

0
 
rindiCommented:
And thanks.
0
 
dissolvedAuthor Commented:
u da man
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now