Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
physical NIC keeps getting DHCP address: not wanted.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
chris_harvey
n00b
n00b


Joined: 12 Mar 2010
Posts: 37
Location: Ottawa, Canada

PostPosted: Wed Mar 28, 2018 3:11 am    Post subject: physical NIC keeps getting DHCP address: not wanted. Reply with quote

When my PC boots (OpenRC) I see the following output from ipconfig
Code:

enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.6  netmask 255.255.255.0  broadcast 192.168.3.255 <----------------
        ether 40:8d:5c:47:37:2b  txqueuelen 1000  (Ethernet)
        RX packets 185  bytes 104967 (102.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 202  bytes 73071 (71.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xef100000-ef120000 

kvm-bridge: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.6  netmask 255.255.255.0  broadcast 192.168.3.255  <-------------------
        ether 40:8d:5c:47:37:2b  txqueuelen 1000  (Ethernet)
        RX packets 184  bytes 101585 (99.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 170  bytes 66768 (65.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 18  bytes 1480 (1.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18  bytes 1480 (1.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ovs-system: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.114.6  netmask 255.255.0.0  broadcast 169.254.255.255
        ether 6e:61:31:6e:02:a3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 32  bytes 6094 (5.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:4b:7f:e8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Notice the duplicate IPV4 addresses.

kvm-bridge is an openvswitch bridge. I'm not doing anything magical with OpenVSwitch, just the most basic setup.

Code:

# ovs-vsctl show
6c40b323-8d75-4d5b-84e5-b2e9c9f3512f
    Bridge kvm-bridge
        Port "enp0s31f6"
            Interface "enp0s31f6"
        Port kvm-bridge
            Interface kvm-bridge
                type: internal


My /etc/conf.d/net:
Code:
config_enp0s31f6=null


My /etc/rc.conf:
Code:
rc_hotplug="!net.*"


Code:
# CONFIG_IP_PNP is not set


dhcpcd -U enp0s31f6
Code:
broadcast_address=192.168.3.255
dhcp_lease_time=7200
dhcp_message_type=5
dhcp_server_identifier=192.168.3.1
domain_name=local
domain_name_servers=192.168.3.1
host_name=Tool
ip_address=192.168.3.6
network_number=192.168.3.0
routers=192.168.3.1
subnet_cidr=24
subnet_mask=255.255.255.0
dhcp6_dump: enp0s31f6: No such file or directory


I've tried dhcpcd -k enp0s31f6, but I keep getting 192.168.3.6 on boot. I want an IPv4LL adddress.

I have to manually run "ifconfig enp0s31f6 0" on each boot to get a connection.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Mar 28, 2018 8:28 am    Post subject: Reply with quote

If you want to disable DHCP and only use IPv4LL for a specifc interface, put this at the end of /etc/dhcpcd.conf

Code:

interface enp0s31f6
    nodhcp

_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
chris_harvey
n00b
n00b


Joined: 12 Mar 2010
Posts: 37
Location: Ottawa, Canada

PostPosted: Wed Mar 28, 2018 11:37 am    Post subject: Reply with quote

UberLord wrote:
If you want to disable DHCP and only use IPv4LL for a specifc interface, put this at the end of /etc/dhcpcd.conf

Code:

interface enp0s31f6
    nodhcp


That worked. Thanks!

I'm curious, why isn't config_enp0s31f6=null enough?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Mar 28, 2018 11:52 am    Post subject: Reply with quote

I don't know, I'm out of touch with how netifrc works these days.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1001
Location: Frankfurt, Germany

PostPosted: Wed Mar 28, 2018 4:06 pm    Post subject: Reply with quote

Your output shows two interfaces with the same MAC address. This looks wrong.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42596
Location: 56N 3W

PostPosted: Wed Mar 28, 2018 6:49 pm    Post subject: Reply with quote

chris_harvey,

Code:
config_enp0s31f6=null


I use ="null" do the quotes matter?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum