BLOGGER TEMPLATES - TWITTER BACKGROUNDS »

Rabu, 27 Januari 2010

Dasar Network Setting Debian

1. Network Settings
A. Seting network interface dengan ifconfig.
- Static IP Address
#ifconfig [interface_name] [ip_address] netmask [mask]
misal :
#ifconfig eth0 192.168.1.15 netmask 255.255.255.0 broadcast 192.168.1.255

nambahin default gateway :
#route add default gateway [ip address] dev [interface_name]
misal :
#route add default gateway 192.168.1.1 dev eth0

- Dynamic IP Address
Perintahnya :
#dhclient [interface]
misal :
#dhclient eth0
Internet Systems Consortium DHCP Client V3.0.3
Copyright 2004-2005 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
Listening on LPF/eth0/aa:00:11:22:33:44
Sending on LPF/eth0/aa:00:11:22:33:44
Sending on Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.130 — renewal in 1002089 seconds.

- Speed dan Duplex Mode
unuk cek speed dan dupex mode seting :
#ethtool [interface_name]
misal:
#ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0×000000ff (255)
Link detected: yes

Untuk seting duplex mode :
#ethtool [interface_name] -s duplex full | half autoneg off

Untuk seting speed :
#ethtool [interface_name] -s 10|100|1000 autoneg off

Untuk mbalikin speed dan duplex mode ke setingan awalny :
#ethtool [interface_name] -s autoneg on

B. Seting network interface secara permanen.
Perintah2 diatas akan berubah saat reboot atau restart service network komputer. Agar g berubah, buka file /etc/network/interface :
#vim /etc/network/interfaces

- Static IP Address
auto eth0
iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
gateway 192.168.1.1

- Dynamic IP Address
auto eth0
iface eth0 inet dhcp

- Speed, duplex mode & routing
auto eth0
iface eth0 inet static|dhcp
post-up /usr/bin/ethtool eth0 -s speed 100 duplex full autoneg off
post-up route add default gateway 192.168.1.1 dev eth0

2. Networking Checks
Untuk cek semua seting interface :
#ifconfig -a

Untuk cek interface tertentu :
#ifconfig [interface]
misal :
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr AA:00:11:22:33:44
inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a800:4ff:0000:000/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1058 errors:0 dropped:0 overruns:0 frame:0
TX packets:638 errors:0 dropped:0 overruns:0 carrier:0
collisions:1 txqueuelen:1000
RX bytes:100716 (98.3 KiB) TX bytes:86309 (84.2 KiB)
Interrupt:169

Untuk cek gateway :
#route -n

3. DNS (Domain Name System)
DNS, dengan name servers, merubah nama domain atau FQDN (Fully Qualified Domain Name) menjadi IP Address.
Contoh, untuk mengakses www.zulfanruri.com FQDN dengan web browser seperti firefox, pertama nama website di terjemahkan menjadi IP Address oleh name server (DNS server)
IP Address name server tersimpan di file /etc/resolv.conf, jika dpt IP Address dinamis (DHCP) maka name server otomatis menambahkan ke file tersebut.
#vim /etc/resolv.conf
nameserver 192.168.1.1

dimana 192.168.1.1 adalah IP Address name server.
Untuk cek, coba perintah :
#dig [namadomain]

4. Proxy
Jika akses internetnya menggunakan proxy, gunakan seting berikut :
#export HTTP_PROXY=”http://login:password@proxy_address:proxy_port”
#export FTP_PROXY=”ftp://login:passowrd@proxy_address:proxy_port”

Untuk cek seting proxy :
#export | grep PROXY
declare -x export HTTP_PROXY=”http://login:password@proxy_address:proxy_port
declare -x export FTP_PROXY=”http://login:password@proxy_address:proxy_port

seting di atas akan hilang saat reboot komputer, sehingga jika pengen seting pemanen ikuti langkah berikut :
cek shell yg dipake :
#echo $SHELL
/bin/bash
akses ke home directory :
#cd ~/
tambahkan seting proxy di file “.bashrc” (hidden):
#vim .bashrc
export HTTP_PROXY=”http://login:password@proxy_address:proxy_port”
export FTP_PROXY=”ftp://login:password@proxy_address:proxy_port”

cek proxy seting :
#cat ~/.bashrc ¦ grep PROXY
export HTTP_PROXY=”http://login:password@proxy_address:proxy_port”
export FTP_PROXY=”ftp://login:password@proxy_address:proxy_port”1. Network Settings
A. Seting network interface dengan ifconfig.
- Static IP Address
#ifconfig [interface_name] [ip_address] netmask [mask]
misal :
#ifconfig eth0 192.168.1.15 netmask 255.255.255.0 broadcast 192.168.1.255

nambahin default gateway :
#route add default gateway [ip address] dev [interface_name]
misal :
#route add default gateway 192.168.1.1 dev eth0

- Dynamic IP Address
Perintahnya :
#dhclient [interface]
misal :
#dhclient eth0
Internet Systems Consortium DHCP Client V3.0.3
Copyright 2004-2005 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
Listening on LPF/eth0/aa:00:11:22:33:44
Sending on LPF/eth0/aa:00:11:22:33:44
Sending on Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.130 — renewal in 1002089 seconds.

- Speed dan Duplex Mode
unuk cek speed dan dupex mode seting :
#ethtool [interface_name]
misal:
#ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0×000000ff (255)
Link detected: yes

Untuk seting duplex mode :
#ethtool [interface_name] -s duplex full | half autoneg off

Untuk seting speed :
#ethtool [interface_name] -s 10|100|1000 autoneg off

Untuk mbalikin speed dan duplex mode ke setingan awalny :
#ethtool [interface_name] -s autoneg on

B. Seting network interface secara permanen.
Perintah2 diatas akan berubah saat reboot atau restart service network komputer. Agar g berubah, buka file /etc/network/interface :
#vim /etc/network/interfaces

- Static IP Address
auto eth0
iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
gateway 192.168.1.1

- Dynamic IP Address
auto eth0
iface eth0 inet dhcp

- Speed, duplex mode & routing
auto eth0
iface eth0 inet static|dhcp
post-up /usr/bin/ethtool eth0 -s speed 100 duplex full autoneg off
post-up route add default gateway 192.168.1.1 dev eth0

2. Networking Checks
Untuk cek semua seting interface :
#ifconfig -a

Untuk cek interface tertentu :
#ifconfig [interface]
misal :
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr AA:00:11:22:33:44
inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a800:4ff:0000:000/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1058 errors:0 dropped:0 overruns:0 frame:0
TX packets:638 errors:0 dropped:0 overruns:0 carrier:0
collisions:1 txqueuelen:1000
RX bytes:100716 (98.3 KiB) TX bytes:86309 (84.2 KiB)
Interrupt:169

Untuk cek gateway :
#route -n

3. DNS (Domain Name System)
DNS, dengan name servers, merubah nama domain atau FQDN (Fully Qualified Domain Name) menjadi IP Address.
Contoh, untuk mengakses www.zulfanruri.com FQDN dengan web browser seperti firefox, pertama nama website di terjemahkan menjadi IP Address oleh name server (DNS server)
IP Address name server tersimpan di file /etc/resolv.conf, jika dpt IP Address dinamis (DHCP) maka name server otomatis menambahkan ke file tersebut.
#vim /etc/resolv.conf
nameserver 192.168.1.1

dimana 192.168.1.1 adalah IP Address name server.
Untuk cek, coba perintah :
#dig [namadomain]

4. Proxy
Jika akses internetnya menggunakan proxy, gunakan seting berikut :
#export HTTP_PROXY=”http://login:password@proxy_address:proxy_port”
#export FTP_PROXY=”ftp://login:passowrd@proxy_address:proxy_port”

Untuk cek seting proxy :
#export | grep PROXY
declare -x export HTTP_PROXY=”http://login:password@proxy_address:proxy_port
declare -x export FTP_PROXY=”http://login:password@proxy_address:proxy_port

seting di atas akan hilang saat reboot komputer, sehingga jika pengen seting pemanen ikuti langkah berikut :
cek shell yg dipake :
#echo $SHELL
/bin/bash
akses ke home directory :
#cd ~/
tambahkan seting proxy di file “.bashrc” (hidden):
#vim .bashrc
export HTTP_PROXY=”http://login:password@proxy_address:proxy_port”
export FTP_PROXY=”ftp://login:password@proxy_address:proxy_port”

cek proxy seting :
#cat ~/.bashrc ¦ grep PROXY
export HTTP_PROXY=”http://login:password@proxy_address:proxy_port”
export FTP_PROXY=”ftp://login:password@proxy_address:proxy_port”

0 komentar: