Title basically reveals what I want to learn. Theoretically, I can assign an IPv4 address via ifconfig <interfaceName> <IP address>, for example ifconfig myInterface 172.16.25.125. However, I could not make sure whether this causes any problem.
Here's why I am asking this question so that it can be answered better. I have two high-gain antennas connected to different computers, which run Ubuntu as OS. I would like to use iperf to make some measurements between those antennas. Each antenna creates a different interface, but when I connect the antennas into the computer they do not have any IP addresses (neither IPv4 nor IPv6). For iperf I need IP addresses so that I can conduct my measurements. I can assign an IPv4 address to each of the antennas without connecting those computers. My initial question arises here: Can I assign any IPv4 address I want to a network interface in Ubuntu? Of course, I do not try assigning the same IPv4 addresses as Local Host(eth0 or wlan0 interface name) or Loop Back(lo interface name). I appreciate your help.
Asked
Active
Viewed 298 times
1
Eric
- 43
2 Answers
2
If you're referring to an internal network, you can assign any IP address you like. If any other devices are already programmed to a specific IP however, you may have conflicts.
If you're referring to an external IP address, the one assigned by your ISP, you get whatever they assign.
WesleyK
- 72
0
From Internet RFC 1918:
1918 Address Allocation for Private Internets. Y. Rekhter, B. Moskowitz,
D. Karrenberg, G. J. de Groot, E. Lear. February 1996. (Format:
TXT=22270 bytes) (Obsoletes RFC1627, RFC1597) (Updated by RFC6761)
(Also BCP0005) (Status: BEST CURRENT PRACTICE) (DOI:
3. Private Address Space
The Internet Assigned Numbers Authority (IANA) has reserved the
following three blocks of the IP address space for private internets:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
waltinator
- 37,856