Arsip Blog

Static DNS dengan DHCP di Linux

Jika menggunakan DHCP (dynamic address), dhcp akan assign nameserver secara otomatis juga ke /etc/resolv.conf.
Adakalanya kita perlu menambahkan entry dns server lainnya, tetapi entry yang kita masukkan secara manual ini akan hilang bila networkingnya kita restart.
Nah bagaimana supaya dhcp client bisa memasukkan custom dns server kita di /etc/resolv.conf ?

Kita perlu mengedit file /etc/dhcp3/dhclient.conf
cari baris berikut :

#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;

Ubah sebagai berikut :

prepend domain-name-servers 1.2.3.4, 1.2.3.5;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, host-name,
netbios-name-servers, netbios-scope;

Replace 1.2.3.4 and 1.2.3.5 with the addresses of your DNS servers.

Run

sudo /etc/init.d/networking force-reload

Iklan

SSH X Forwarding

Betapa merananya dapat jatah PC dng RAM cuma 256, sementara jalanin linuxmint lumayan empot2an.
jadi kepikiran gimana ya kalo jalanin aplikasinya numpang di PC tetangga yang lumayan cepet.
Nah setelah googling dapat jawabannya SSH X Forwarding, atau melewatkan data grafis tampilan melalui SSH tunnel.

Beberapa langkahnya secara umum adalah :
Di PC yang kita pakai (local computer), jalankan
# xhost +
Perintah ini membuat X server yang ada di PC bisa menerima paket dari host manapun.
Jalankan SSH Forwarding dengan perintah :
# ssh -X user@server
User dan server adalah nama login anda pada server yang dituju.

Setelah masuk ke dalam server lewat SSH, jalankan perintah :
# set DISPLAY my-host=:0.0
# export DISPLAY

ganti my-host dengan ip atau hostname
Perintah di atas akan membuat semua tampilan grafis dari perintah yang dijalankan akan ditampilkan pada local computer.
Silakan coba aplikasi berbasis grafis. In this case, saya coba buka Mozilla web browser.
daliman@remote-pc:~$ mozilla-firefox

and voila firefox nongol di remote pc nongol di desktop saya

Acces Network Share via FuseSMB on Linux Mint

Untuk mengakses network share biasanya kita gunakan Nautilus melalui Network Browse atau Connect to Server, namun dengan cara ini kita tidak dapat mengedit langsung file yg ada di network shared (copy dulu ke local folder)

Dengan fasilitas fusesmb yang sudah ada di linux mint, mengakses network shared menjadi mudah. terutama dilingkungan windows domain dengan banyak shared folder
berikut caranya.

edit /home/daliman/.smb/fusesmb.conf

$ sudo vi /home/daliman/.smb/fusesmb.conf

masukkan minimal baris berikut

[global]

; Default username and password
username=user
password=totallysecret
interval=10
#
sesuaikan username dan password diatas sesuai dengan username domain dari user bersangkutan.
save, dan exit
configurasi lebih lengkap dapat dilihat dari man fusesmb.conf

Sekarang user dapat mengakses network dengan mudah seperti di local melalui Network folder yang ada di nautilus, di home foldernya ada Network folder,

shared folder yang diinginkan dapat dibuat shorcutnya dengan menarik ke sidebar sebelah kiri

untuk meng-update cache jalankan perintah :
$ fusesmb.cache

incase fusesmb having error about permission, execute follwing command :
$ sudo chmod o+xr /usr/bin/fusermount
$ sudo chmod o+xr /dev/fuse
$ fusesmb /home/user/network

Configuring VLANs Under Fedora

The configuration of VLANs under FC/RHEL/CentOS is something that I always end up looking in the “ifup” script and experimenting around with. This is made worse by there being two different conventions that can be used for the interface naming. Here’s how I set up VLANs.

First of all, the base interface needs to be configured. Usually, it’s already got at least a stub file, which needs to be modified to have the following elements:

DEVICE=eth0 # use real interface name here
BOOTPROTO=static
HWADDR=AA:17:31:9C:8D:BC # use real MAC address here
ONBOOT=no
TYPE=Ethernet
IPADDR=0.0.0.0
NETMASK=255.255.255.0

In this example, I am configuring the device “eth0″ (the file /etc/sysconfig/network-scripts/ifcfg-eth0”, with the MAC address of “AA:17:31:9C:8D:BC”. You will need to plug in your system’s values for these two lines, and the rest should be left the same.

For “vlanX” Interfaces
If you want your interfaces named “vlanX”, use this section. The next section describes how to set it up for interfaces named “eth0.X”. The benefit of vlanX naming is that if you only have one VLAN name-space, you don’t have to care about which interface has the VLAN tagging enabled on it. If you move the physical interface, the vlan interface names stay the same, so you don’t have to modify firewall rules, etc…
Read the rest of this entry

Samba as a NT Domain Member

Samba emulates a NT workstation when becoming part of the domain. So, the first thing you need to do is create a machine account for your Samba machine on the domain controller. In NT you would use the program Server Manager for Domains to create the account. Once the account is created, all you need to add are the following lines to your smb.conf file under the global section.
# Your Workgroup or Domain that you want
# to login to
workgroup = FREEOS

# Tell Samba to talk to domain controller
# for authentication
security = domain

# Specify the server to get authenticate
# from. You can specify the
# NetBIOS # names of the servers or simply
# put in a “*” here to let
# Samba find the server through broadcast
password server = PS1 PS2

# Make sure Samba is using encrypted
# passwords
encrypt passwords = yes

Now stop the Samba daemons

/etc/rc.d/init.d/smb stop

Give the following command to join the NT Domain

smbpasswd -j DOMAIN -r DOMAINPDC