1
Is there some basic Linux way to assign a static IP address without writing some files, just for the current session until reboot?
1
Is there some basic Linux way to assign a static IP address without writing some files, just for the current session until reboot?
1
IIUC, you can do that with ifconfig
tool. Most Linux
-based systems come with ifconfig
by default. Usage:
ifconfig <interface> <IP>
Example:
ifconfig eth0 192.168.100.100
1
Just for completeness: ifconfig
has been superseded by ip
. ip
has more functionality, a cleaner syntax, and it's easier to parse the output in scripts.
Assuming you want to add a /24
address on eth0
, use:
ip addr add 192.168.100.100/24 dev eth0
Just
ip addr
will show the assigned addresses for all interfaces.