LFS Install OpenSSH, Samba and Configure IP - Unbelievable - Behind every successful Ultraman, there is a little monster that silently takes the beating... sink

by stilling2006 on 2009-09-07 22:32:37

People who use a LIVECD to install LFS know that the CD package contains the ifconfig tool. Moreover, tools like wget can automatically connect to the Internet. However, after I installed LFS, I had to configure resolv.conf and IPv4 (or ifconfig.eth0) to be able to access the Internet in a virtual machine environment and also use SSH.

Those using DHCP don't need to worry about this, but I'll document how I set up a static IP. The old method is to first boot with the LIVECD, then run ifconfig to record the IP address. Then enter the command "route -n". I only need three pieces of data from this: one is the IP address, one is the gateway, and the other is the nameserver (I filled in the backup nameserver arbitrarily). These three data points can be obtained through the above two commands. Afterward, reboot, remove the LIVECD, and upon entering LFS, just configure the settings properly (such as /etc/sysconfig/network-devices/ifconfig.eth0/ipv4 and /etc/resolv.conf).

This way, everything will work as expected.