Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- ip address add 192.168.122.22/24 dev enP1p1s0f0
- ip address del 192.168.122.22/24 dev enP1p1s0f0
- Here are a couple of things to keep in mind about these commands:
- 1. If you do note specify the prefix (/24 in this case) to the IP address the default is /32.
- 2. The interface is brought up automatically. There is no need to run ifup
- 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