[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

re: question about ifup and ifconfig

i have my laptop so:
  case "$1" in
	doopt spoofprotect yes
        doopt syncookies no
        doopt ip_forward no

        echo -n "Configuring network interfaces: "
	echo "please select your environment:"
	echo "[1]:home"
	echo "[2]:office"
	read home_office
	if [ $home_office -eq "1" ]; then
        	ifup -a -i /etc/network/interfaces.home	
		rm -f /etc/resolv.conf
		ln -s /etc/resolv.conf.home /etc/resolv.conf
		rm -f /etc/apt/apt.conf
	elif [ $home_office -eq "2" ]; then
        	ifup -a -i /etc/network/interfaces.office		
		rm -f /etc/resolv.conf
		ln -s /etc/resolv.conf.office /etc/resolv.conf
		if [ ! -f /etc/apt/apt.conf ]; then
			ln -s /etc/apt/apt.conf.office
	echo "done."

and it works good.
my question here is: 
	1) is ifup/ifdown written in c and realized a set function of
ifconfig and add route table?
	2) how can i use ifconfig to bring up eth0 with dhcp?


Reply to: