Jumat, 06 Juli 2007

PC Router in Slackware Linux

Mmmm...I'm very sleepy, I wanna sleep now. But I must post about my passion. Ok....let's begin!
Now, I'd not present about installation slackware Linux, but there are only some methode to configure our PC to be PC Router. And in this chance I'll use Slackware Linux.
Ok....
After We configure the network, exam:
eth0 ==> 202.155.0.187 netmask 255.255.255.248 and ISP's gateway 202.155.0.185
eth1 ==> 172.16.1.33 netmask 255.255.255.224
and you should add name server ...
vi /etc/resolv.conf
insert your own domain name server!
after it....We should make active ip forwarding, and run it with type:
/etc/rc.d/rc.ip_forward start
And then, you may create some firewall script.
iptables -A INPUT -i eth0 -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
And that rules will allow incoming packet from eth0 and eth1.

-iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
-iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
and that rules will make some relation between network A and network B, so they can communicate together.

-iptables -A OUTPUT -o eth0 -j ACCEPT
-iptables -A OUTPUT -o eth1 -j ACCEPT
and that rules will allow outgoing connection or packet from eth0 and eth1.

Now, if you're really have the connection to the Internet. You should set your rule iptables, and using NAT (Network Address Translation) to make your private network get Internet access.
-iptables - t nat -A POSTROUTING -s (your network ip / subnet mask) -d 0.0.0.0/0 -j SNAT --to-source (your ip public)
Ok, finish and you've made some rule to put in your firewall. And now you have to save them.
Now, create a new file in specific directory, for example in /etc/firewall.scrpt and of course use text editor. examp "vi"
-vi /etc/firewall.scrpt
then save and exit!
-:wq!
Now, you have to save your iptables rule in that file.
-iptables-save > /etc/firewall.scrpt
Ok, Finish.......
Now you must test your PC Router that shown "work".
Ping to router.....if reply, that mean success
-ping to ISP's gateway.....if reply, you've succed too.
-ping to google.com.....if reply, you're really succes configure your PC to be PC Router.
Ok...that's all from me....
And Good luck, ......
I wanna sleep....I'm very sleepy.....huauaauaaaaaaaaaaaaah....ah.

Regard's...
Malx


Kamis, 05 Juli 2007

Installing Proxy Server on Debian...

To the point...

Install squid package!
-apt-get install squid
edit file /etc/squid.conf with your favorite text editor.
-vi /etc/squid.conf

This is importance:
http_port 8080/3128 or it's up to you the importance

Find the following directives, uncomment
them, and change them to the appropriate values:
· httpd_accel_host virtual
· httpd_accel_port 80
· httpd_accel_with_proxy on
· httpd_accel_uses_host_header on

And find again acccelerator.....
Finally, look at the http_access directive. The default is usually ``http_access deny all''. This will prevent
anyone from accessing squid. For now, you can change this to ``http_access allow all'', but once it is working,
you will probably want to read the directions on ACLs (Access Control Lists), and setup the cache such that
only people on your local network (or whatever) can access the cache. This may seem silly, but you should
put some kind of restrictions on access to your cache. People behind filtering firewalls (such as porn filters, or
filters in nations where speech is not very free) often ``hijack'' onto wide open proxies and eat up your
bandwidth.

After finish editing, save and exit!...
:wq!

And you should give some rule in firewall to redirect connection http to squid port.
Like this:
-iptables -t nat -I PREROUTING -s (your ip network/subnetmask) -d 0.0.0.0/0 -p tcp --dport 80 -j REDIRECT --to-port 3128(it's up to you, as you configured)
example:
-iptables -t nat -I PREROUTING -s 172.11.0.32/27 -d 0.0.0.0/0 -p tcp --dport 80 -j REDIRECT --to-port 3128.

And now...you may run the squid for the first time...(just once)
-squid -z
and then start the proxy service!
/etc/init.d/squid start
Ok, now you have installed and configuring your PC as transparent proxy server.
....Good Luck...
AnD happy with your proxy machine.... :)


Best Regard's....
Malx


Minggu, 01 Juli 2007

Installing and configuring DNS server using Debian

Hello guys, in this chance I'm gonna try to write about my reffer. And I called it configuring DNS server with BIND in using Debian Woody. For the first, If our debian linux system ready. Login as root!. If we install bind manually They are some methode to do!
1. mount debian installer cd with
root@debian#mount /cdrom
then, go to directory pools/main/b/
type !
root@debian#apt-get install bind-9.x.x.deb
wait a few minute while debian linux installing bind on your system.
and now, we have ready to configure our DNS server.
Edit file named.conf in directory /etc/bind (in this chance I use vi editor to edit that file. But, it's up to you, choose text editor what do you want. And in this tutor, the domain is tkj.edu.
root@debian#vi /etc/bind/named.conf
That will show.
opitons {
// directory "/var/cache/bind";
// query-source address 192.168.5.122 port 53;
// forwarders {
// 219.83.116.186;
// };
};

zone "tkj.edu" {
type master;
file "/etc/bind/tkj";
};

zone "5.168.192.in-addr.arpa." {
type master;
file "/etc/bind/reverse";
};

after it, save and exit with type ":wq!"

and now you have to make the zone file and reverse zone file, in directory as you edited in file named.conf

root@debian#vi /etc/bind/tkj
and you have to put some configuration like this;
dns rev:
$TTL 604800
5.168.192.in-addr.arpa. IN SOA debian. root.tkj.edu. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Exipire
604800 ) ; Negative Cache TTL

;
@ IN NS debian.tkj.edu.
@ IN MX 10 debian.tkj.edu.
debian IN A 192.168.5.122
www IN CNAME debian.tkj.edu.


then save and exit, with type ":wq!"
after it, you must create reverse zone file
root@debian#vi /etc/bind/reverse
then put some configuration like this;

tkj's zone file :
$TTL 64800
@ IN SOA debian root.tkj.edu (
1 ; serial
7200 ; refresh
7200 ; retry
36000 ; expire
7200 ) ; mimimum
;
@ IN NS debian.tkj.edu.

debian IN A 192.168.5.122

122 IN PTR debian.tkj.edu.

then save and exit, with type ":wq!"

and now you should configure dns resolver.
Edit file of directory /etc/resolv.conf
and put some configuration there!

resolve dns:
search tkj.edu
nameserver 192.168.5.122
then save and exit with type ":wq"

and now you should configure the host file.

root@debian#vi /etc/hosts

put some configuration there!
127.0.0.1 localhost
192.168.5.122 debian.tkj.edu debian


Note: IP address in that domain is 192.168.5.122
and that host has domain tkj.edu

Ok guys, our tutor finished. Good luck...and try to operate it on your DNS Server!! :)
always here!!!
Debian Linux

Me and Linux


Maybe, now all of peoples known about many distro in the world. Like Slackware, Debian,Trustix, Fedora, SUSE, Mandriva and other. But also many distro, I always using three distro. And There are my favorite distro. Like Slackware, It has simple, stable, secure and it works. Debian, It has stable, secure and clasicc behavior( that's for me). :) Trustix, It called Server optimized Linux. It has good security. Mmmh but, that hang toward their adminstator who operates them. "Man Behind the Gun". :) Ok, maybe enough for the first post. Hehe It's just introuction.
Regards...

Malx