How would I assign an IP address usng ip
(the Linux tool)? I've been doing it with ifconfig
so far.
Asked
Active
Viewed 248 times
3 Answers
3
From the ip man page:
ip addr { add | del } IFADDR dev STRING
Therefore:
ip addr add 192.168.0.1 dev eth0

growse
- 8,020
- 13
- 74
- 115
2
ip addr add a.b.c.d/mm brd + dev iface
brd +
means asking iproute2 to automatically calculate the broadcast address based on the subnet information. E.g.:
ip addr add 192.168.4.55/24 brd + dev eth0

pepoluan
- 5,038
- 4
- 47
- 72