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
留言
張貼留言