ubuntu version :
Desired new sample settings:
=> Host IP address 192.168.1.100
=> Netmask: 255.255.255.0
=> Network ID: 192.168.1.0
=> Broadcast IP: 192.168.1.255
=> Gateway/Router IP: 192.168.1.254
=> DNS Server: 192.168.1.254
Open network configuration file
$ sudo vi /etc/network/interfaces
OR
$ sudo nano /etc/network/interfaces
You will see something like:
" iface eth0 inet dhcp "
or maybe
" auto lo "
" iface lo inet loopback "
Delete all that words, Change it become:
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
Save and close the file. Restart the network:
$ sudo /etc/init.d/networking restart
<bold><b> Task: Define new DNS servers</b></bold>
Open /etc/resolv.conf file
$ sudo vi /etc/resolv.conf
You need to remove old DNS server assigned by DHCP server:
search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30
Save and close the file.
Task: Test DNS server
root@dikayeah-desktop:/etc/network# host ragezone.com
ragezone.com has address 69.163.33.187
ragezone.com mail is handled by 1 aspmx.l.google.com.
Network command line cheat sheet
You can also use commands to change settings. Please note that these settings are temporary and not the permanent. Use above method to make network changes permanent or GUI tool as described below.
Task: Display network interface information
$ ifconfig
Task: Take down network interface eth0 / take a network interface down
$ sudo ifconfig eth0 down
OR
$ sudo ifdown eth0
Task: Bring a network interface eth0 up
$ sudo ifconfig eth0 up
OR
$ sudo ifup eth0
Task: Change IP address and netmask from command line
Activate network interface eth0 with a new IP (192.168.1.50) / netmask:
$ sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 up
Task: Display the routing table
$ /sbin/route
OR
$ /sbin/route -n
Example output:
root@dikayeah-desktop:/etc/network# /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth1
10.14.0.0 0.0.0.0 255.255.0.0 U 1 0 0 eth1
0.0.0.0 10.14.207.1 0.0.0.0 UG 0 0 0 eth1
Task: Add a new gateway
$ sudo route add default gw 69.69.69.69 <<-- i like this number
ihihihihihih...
NB:
1. eth0 is a network card. so its depend which network card which do you use. i use 2 network card, so i use eth1 for my setting
2. however, you still need to do Port Forwarding from your ADSL modem. PW port is " 29000 "