Solved How to set dhcp newtwork ?

mybsd

Member

Reaction score: 2
Messages: 22

I have not set the network during installation,my home network is simple:

isp ----> moden ----> router ----> pc

In debian , i edit the /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug enp1s0
iface enp1s0 inet dhcp

It say how to set dhcp during installation in the handbook, i have not searched how to set dhcp after installation.
handbook

How to edit the /etc/rc.conf for dhcp?
 

Jose

Daemon

Reaction score: 895
Messages: 1,092

Code:
ifconfig_dc0="DHCP"
"Replace dc0 with the correct value for the system."
 

CuatroTorres

Member
Developer

Reaction score: 38
Messages: 83

Just a note: It's possible to run bsdinstall after installation and configure the network connection. Can it have any unwanted side effects?
 

CuatroTorres

Member
Developer

Reaction score: 38
Messages: 83

Oh thanks, I wasn't on the keyboard and I really referred to that command as a simpler means when you don't remember the tags for /etc/rc.conf. It also resolved my doubt.
 

CuatroTorres

Member
Developer

Reaction score: 38
Messages: 83

I ate my own dog food. I did an ethernet installation and I wanted to configure the wifi with bsdconfig later, then it didn't identify any hardware, then:

Code:
dmesg | grep -i wireless
ifconfig wlan0 create wlandev wpi0
ifconfig wlan0 up

I created the interface and bsdconfig returned the list of networks but I couldn't configure my network, pressing enter just didn't do anything. What was missing?
 

Neubert

Member

Reaction score: 30
Messages: 55

I tried bsdconfig for the first time on a Lenovo X220 last week and was never able to get it to work in 13.0-RELEASE-p3. Even after I successfully configured Wi-Fi by hand, bsdconfig would not produce a list of SSIDs for me to select like it does when doing a Wi-Fi installation from scratch.

IMG_20210801_104625161.jpg


I remember seeing two different error messages while messing with it, one of which I think was wireless cannot be configured without making changes to the local system. I don't have the other error message in my notes and don't remember what it was. I do remember that the Wi-Fi device was listed as unknown device on the first dialog, where I think it should have been recognized.

This script by jrm@ worked well for me, but the settings don't survive a reboot.

In the end, I got it working by changing the files by hand.

Code:
$ su
# sysctl net.wlan.devices
net.wlan.devices: iwn0
# echo 'wlans_iwn0="wlan0"' >> /etc/rc.conf
# echo 'ifconfig_wlan0="WPA SYNCDHCP"' >> /etc/rc.conf
# cat /etc/wpa_supplicant.conf
network={
    ssid="xxxx"
    psk="xxxx"
}
# service netif restart
# ping 8.8.8.8
 
Top