LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Blogs > arisnb
User Name
Password

Notices

Rate this Entry

Simple network configuration ala tukang nggame

Posted 05-15-2009 at 07:08 AM by arisnb
Updated 05-17-2009 at 08:03 PM by arisnb

How to configure simple PC router ? Tukang Nggame have simple practice tips. You can configure your PC router with GNU/Linux Debian Lenny or the other.

ISP---------eth0-ROUTER-eth1---------clients
You can download that topology as picture at

http://farm4.static.flickr.com/3577/...fda0ab92a6.jpg


No we configure PC Router (ROUTER) and we use GNU/Linux Debian. If eth0 and eth1 DOWN :

Code:
ifconfig eth0 up
ifconfig eth1 up
Edit IP Address configuration at /etc/network/interfaces file :
Code:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
        address 202.172.1.3
        netmask 255.255.255.248
        network 202.172.1.0
        gateway 203.130.244.241
        dns-nameservers 202.172.1.1

allow-hotplug eth1
auto eth1
iface eth1 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
Edit /proc/sys/net/ipv4/ip_forward
Code:
1
You can edit with this command with console

Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
Restart networking with command line at linux console as root user.
Code:
# /etc/init.d/networking restart
If iptables was installed. Then, install shorewall.
Code:
#apt-get install shorewall
Edit default configuration /etc/default/shorewall
Code:
startup=1
Edit /etc/shorewall/zones file
Code:
loc     ipv4
net     ipv4
Edit /etc/shorewall/interfaces file

Code:
net     eth0    detect    blacklist
loc     eth1    detect    blacklist
Edit /etc/shorewall/masq file

Code:
eth0    eth1
Edit /etc/shorewall/policy . Close all port as default.

Code:
fw      net     REJECT
fw      loc     REJECT

loc     fw      REJECT
loc     net     REJECT

net     all     DROP
all     all     DROP
Edit /etc/shorewall/rules file. Open port for special port and clients.

Code:
ACCEPT          loc          net     tcp     25,143,110,80,443 #smtp,imap,pop,http,https
ACCEPT          fw           loc     tcp     25,143,110,80,443 #smtp,imap,pop,http,https
Edit /etc/shorewall/routestopped file

Code:
eth0            -
eth1            -
Start Shorewall
Code:
# /etc/init.d/shorewall start
Edit DNS resolve /etc/resolv.conf
Code:
nameserver 202.172.1.1
Then, setting clients IP Address 192.168.1.2, 192.168.1.3, 192.168.1.4 ...
Seting gateway 192.168.1.1 and DNS 202.172.1.1

Then browse internet from browser at clients example http://www.example.com/tukangnggame/

Ok, simple....
Posted in Uncategorized
Views 2704 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration