Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. I am constantly needing to set an IP on a server for some reason. Most of the time the reason is to verify connectivity. Here is the commands I use to add and remove the IP.
  2.  
  3. ip address add 192.168.122.22/24 dev enP1p1s0f0
  4. ip address del 192.168.122.22/24 dev enP1p1s0f0
  5.  
  6. Here are a couple of things to keep in mind about these commands:
  7.  
  8. 1. If you do note specify the prefix (/24 in this case) to the IP address the default is /32.
  9. 2. The interface is brought up automatically. There is no need to run ifup
  10. 3. I believe ifup and ifdown assume there config files (/etc/sysconf/network-scripts/ifcfg-* for RPM based systems).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement