關於注釋的使用
/etc/network/interfaces 中加入的注釋似乎只能在每行的行頭開始加入.
例如:
正確:
#comment here!
iface .....
錯誤:
iface .................. # comment in here may cause error : too many parameters for iface line.
該檔案供ifup ifdown 使用,可通過設置一些不同的環境佈局以適應不同的網境要求。
例如:在家中使用靜態ip192.168.0.1 在學校ip 10.0.0.1
iface eth0 inet dhcp
/etc/network/interfaces 中加入的注釋似乎只能在每行的行頭開始加入.
例如:
正確:
#comment here!
iface .....
錯誤:
iface .................. # comment in here may cause error : too many parameters for iface line.
該檔案供ifup ifdown 使用,可通過設置一些不同的環境佈局以適應不同的網境要求。
例如:在家中使用靜態ip192.168.0.1 在學校ip 10.0.0.1
iface eth0 inet dhcp
home inet static
ip 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.1
school inet static
ip 10.0.0.200
netmask 255.255.255.0
gateway 10.0.0.1
#end of /etc/network/interfaces
以後只要在用ifup時加入適當参數便可使用該設定,例:
#ifup eth0=home
使用靜態ip 192.168.0.50 掩碼255.255.255.0 網關192.168.0.1的設定。
若在學校時可用ifup eth0=school,而ip為靜態10.0.0.1
而ifup eth0則為使用dhcp。
No comments:
Post a Comment