簡單幾步,讓你用ADSL上網 FreeBSD ADSL 安裝Go!Go!Go!
1.配置網絡連接
先登錄系統,這樣:
Login: root (以Root用戶登錄)
Password: (輸入你的密碼,因安全問題,這裡你看不到輸入的結果.)
CODE:#################################################################
# PPP Sample Configuration File
# Originally written by Toshiharu OHNO
#
# See /usr/share/examples/ppp/ for some examples
#
#################################################################
default:
set log Phase Chat LCP IPCP CCP tun command
ident user-ppp VERSION (built COMPILATIONDATE)
# Ensure that "device" references the correct serial port
# for your modem. (cuaa0 = COM1, cuaa1 = COM2)
#
set device PPPoE:lnc0
set speed sync
set mru 1492
set mtu 1492
set ctsrts off
set timeout 30 # 3 minute idle timer (the default)
disable lqr
deny lqr
add default HISADDR
hz163: # 注意:這裡的hz163是你的ISP名,要比下面的set語句多出一點(一個空格).
set authname user(把這裡的user換成你的ADSL用戶名)
set authkey password (把這裡的password換成你的ADSL密碼)
set dial
set login
set ifaddr 10.0.0.1/0 10.0.0.2/0
nat enable yes連接網絡
CODE:#ppp –ddial hz163之後看看連接狀態。
CODE:#ifconfig我的結果:
CODE:lnc0: flags=8843 mtu 1500
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::20c:29ff:fe98:25a6%lnc0 prefixlen 64 scopeid 0x1 ether 00:0c:29:98:25:a6
lp0: flags=8810 mtu 1500
lo0: flags=8049 mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
ppp0: flags=8010 mtu 1500
sl0: flags=c010 mtu 552
faith0: flags=8002 mtu 1500
tun0: flags=8051 mtu 1492
inet 218.72.106.94 --> 61.174.64.21 netmask 0xffffffff
Opened by PID 54inet後的數字部分就是:ISP分的IP地址 -> ISP的DNS服務器的IP. 這樣你就上了網啦!
CODE:ifconfig_lnc0="192.168.0.254/24"
defaultrouter="192.168.0.254"
inetd_enable="yes"
gateway_enable="yes"
ppp_enable="yes"
ppp_mode="ddial"
ppp_nat="yes"
ppp_profile="hz163"
named_enable="yes"這幾句就把FreeBSD虛擬機配置成了一NAT網關,兼軟路由、BIND8名字服務器。
簡單吧??
嘿嘿!!!!