How to set the static IP address on Ubuntu and pppoe when system boot

How to set the static IP address on Ubuntu:



$ sudo nano /etc/network/interfaces

then in nano editor add the following texts: 

# The loopback network interfaceauto loiface lo inet loopback
auto dsl-provideriface dsl-provider inet ppppre-up /bin/ip link set eth0 up # line maintained by pppoeconfprovider dsl-provider
auto eth0#iface eth0 inet manual# setting static ip...iface eth0 inet static        # ip address...        address 10.176.0.88        # network mask...        netmask 255.255.255.0        network 10.176.0.0        broadcast 10.176.0.255        # default gatway...        gatway 10.176.0.1


then ctrl+O & ctrl+x save and return to the command line:

restart the network:

$ sudo /etc/init.d/networking restart


if you need start pppoe when system booted, using the commands :

Press Ctrl+Alt+T or go to Applications -> Accessories -> Terminal. Run:

in terminal:

$ sudo pppoeconf


Set the username and password.


Now to connect, run this pon command in the terminal:

$ sudo pon dsl-provider


To disconnect:

sudo poff


We really want it to connect automatically though, so edit /etc/rc.local by running:

$ sudo nano /etc/rc.local


That opens the file in a text editor. Before the line that says exit 0, add these lines:

# For PPP auto-connect.killall pppdifconfig eth0 uppon dsl-provider



留言

這個網誌中的熱門文章

【多益】現點現做的英文怎麼說呢?

《Microsoft Word 應用》:圖片被文字蓋住解決方法,不可設定為固定行高

如何在Ubuntu系統上安裝Notepad ++ (Install Notepad++ On Ubuntu 16.04 / 17.10 / 18.04 / 20.04)