Saturday, February 24, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2468  / 3 Years ago, tue, august 10, 2021, 1:39:52

When I run more interfaces I get


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

I am on wifi. How to konw my ip is static or dynamic? When run ip addr I get


1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether e0:d5:5e:78:64:ef brd ff:ff:ff:ff:ff:ff
3: wlx00e02d051a2d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:e0:2d:05:1a:2d brd ff:ff:ff:ff:ff:ff
inet 192.168.43.87/24 brd 192.168.43.255 scope global dynamic noprefixroute wlx00e02d051a2d
valid_lft 2283sec preferred_lft 2283sec
inet6 2401:4900:4c6a:ba87:2348:3cc3:5ff9:337/64 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::5cde:b91:60ef:2ee1/64 scope link noprefixroute
valid_lft forever preferred_lft forever

I think ipv4 is dynamic, what about ipv6? Is it static?


More From » networking

 Answers
7

If you run ip addr from a terminal window the output should tell you. The line that starts with inet in the output will tell you. Dynamic will say but Static will be blank. Plus, the line containing valid_lft and preferred_lft will show time remaining if dynamic. I have put some examples below.


DHCP or Dynamic IP Address:


$ ip addr
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 40:8d:5c:4f:12:03 brd ff:ff:ff:ff:ff:ff
altname enp3s0
inet 10.0.0.100/24 brd 10.0.0.255 scope global dynamic noprefixroute eth0
valid_lft 28899sec preferred_lft 28899sec

Static IP Address:


$ ip addr
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether bc:5f:f4:79:66:fe brd ff:ff:ff:ff:ff:ff
inet 10.0.0.220/24 brd 10.0.0.255 scope global bond0
valid_lft forever preferred_lft forever

Hope this helps!


[#2098] Wednesday, August 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
overine

Total Points: 20
Total Questions: 109
Total Answers: 98

Location: Aruba
Member since Fri, Jun 24, 2022
2 Years ago
overine questions
Tue, Jul 12, 22, 00:27, 2 Years ago
Wed, Jan 11, 23, 02:15, 1 Year ago
Sun, Aug 22, 21, 20:50, 3 Years ago
;