NETWORKING WITH 2 LAN CARDS

Discussion regarding the installation and configuration of Linux distributions.

NETWORKING WITH 2 LAN CARDS

Postby Siraj Ahmed » Fri Feb 09, 2007 3:18 pm

:arrow: [img] Assalam o Alykum ,
Sub dosto aur bhaiyon ko mera salam mera senerio ye hai

1. mera internet connect hai windows 2000 Professional per Santic
Isdn k throug jis k lan card ki ip hai 192.168.0.1

2. meri linux ki machine per Red Hat Enterprize 3 installed hai 2 lan
card k sath. eth0=192.168.0.2 and eth1= 10.0.0.1
eth0 connected hai Windows Professional k sath (with net sharing)
eth1 connected hai client k sath.

mai jo kar chuka ho uski tafsil nechey hai

a> DHCPD configured hai
b> Squid ki basic configuration kar chuka hoo
c> Swap directory creat hai

lekin client side perr net nahi chal raha hai



[/img]
Siraj Ahmed
Lance Naik
 
Posts: 25
Joined: Thu Dec 08, 2005 10:22 pm
WLM: sscable@hotmail.com
Yahoo Messenger: sscable2002@yahoo.com
AOL: New+Karachi
Location: New Karachi

Postby [-RHEL-] » Fri Feb 09, 2007 4:19 pm

AOA



Step 1 :
your Window IP
ip = 192.168.0.1
sn = 255.255.255.0

Step 2 :
Linux ip

Eth0
ip = 192.168.0.2
sn = 255.255.255.0
gw = 192.168.0.1
dns = 192.168.0.1

Eth1
ip = 10.0.0.1
sn = 255.0.0.0
step 3 :
for iptables

~]# iptables -A PREROUTING -s 10.0.0.0/255.0.0.0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
~]# iptavles -A POSTROUTING -s 10.0.0.0/255.0.0.0 -o eth0 -j MASQUERADE
~]# iptables -A INPUT -s 127.0.0.1 -j REJECT --reject-with icmp-port-unreachable

Step 4 :
echo 1 > /proc/sys/net/ipv4/ip_forward

Step 5 :
DHCP

-------------------------

Ddns-update-style none;
ignore client-updates;

subnet 10.0.0.0 netmask 255.0.0.0 {

# --- default gateway
option routers 10.0.0.1;
option subnet-mask 255.0.0.0;
option nis-domain "yourdomain.com";
option domain-name "yourdomain.com";
option domain-name-servers 192.168.0.1;
option time-offset -18000; # Eastern Standard Time
# we want the nameserver to appear at a fixed address

host test {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 10.0.0.4;
}
}
___________________________________________________________

i hope you solve your prob.. 4 this

Best Regards
SroNey
[-RHEL-]
Cadet
 
Posts: 9
Joined: Fri Jan 19, 2007 7:24 am
WLM: sroney_lee@hotmail.com
Location: Lahore

Re: NETWORKING WITH 2 LAN CARDS

Postby irfanbhatti » Fri Feb 09, 2007 4:37 pm

Siraj Ahmed wrote::arrow: [img] Assalam o Alykum ,
Sub dosto aur bhaiyon ko mera salam mera senerio ye hai

1. mera internet connect hai windows 2000 Professional per Santic
Isdn k throug jis k lan card ki ip hai 192.168.0.1

2. meri linux ki machine per Red Hat Enterprize 3 installed hai 2 lan
card k sath. eth0=192.168.0.2 and eth1= 10.0.0.1
eth0 connected hai Windows Professional k sath (with net sharing)
eth1 connected hai client k sath.

mai jo kar chuka ho uski tafsil nechey hai

a> DHCPD configured hai
b> Squid ki basic configuration kar chuka hoo
c> Swap directory creat hai

lekin client side perr net nahi chal raha hai



[/img]


first what is your gate way

then see is your squid listing by view

taif -f /var/log/squid/access.log

if iptables stoping ur squid then open ur squid port in firewall

run setup fron cli mode then go to firewall open squid port

and enable pakect forwading

echo 1 > /proc/sys/net/ipv4/ip_forward
Muhammad Irfan
03335246272
irfanbhatti
Havaldaar
 
Posts: 145
Joined: Fri Jun 03, 2005 12:19 pm
Yahoo Messenger: capricorn201_4u
Location: Rawalpindi Islamabad

Postby Zaheer » Sat Feb 10, 2007 12:18 pm

Assalam O Alaikum,

Do you have switch in between these 3 computers.Check the cable also because it can be a issue of crossover and straight through cable.And let us know
Good Judgement comes from Experience and Experience comes from bad Judgement!!
The more I know, the more I realize I don't know!?
The easiest way to find out is to try Out!!!

Registered Linux user #333501
Zaheer
Battalion Havaldaar Major
 
Posts: 284
Joined: Fri Oct 17, 2003 12:15 am
WLM: zaheermb20@hotmail.com
Yahoo Messenger: zaheermb2002@yahoo.com
Location: Karachi

Postby ranatanveer » Sat Feb 10, 2007 1:52 pm

I agree with RHEL

but if you start your named service cache only than you can provide 10.0.0.1 ip as DNS server to your cleints.
Regards

Rana Tanveer
+923224194457
Linux Student

For Affordable Web Development http://www.affordableprogrammers.com
http://www.qualityprogrammers.com
ranatanveer
Subedar
 
Posts: 355
Joined: Sat May 07, 2005 11:54 am
ICQ: 133032001
Website: http://www.affordableprogrammers.com
WLM: ranatanveer@gmail.com
Yahoo Messenger: ranahard@yahoo.com
Location: Lahore

Postby [-RHEL-] » Sat Feb 10, 2007 2:18 pm

AOA

r u right ranatanveer
but it's typing mistake...
sory for this..
[-RHEL-]
Cadet
 
Posts: 9
Joined: Fri Jan 19, 2007 7:24 am
WLM: sroney_lee@hotmail.com
Location: Lahore

Postby sarthor » Sat Feb 10, 2007 8:41 pm

[-RHEL-] wrote:AOA

r u right ranatanveer
but it's typing mistake...
sory for this..

Salam O Alykum.
typing mistake? I think Its a kind of mistake like forgetting something.
isnt it?
BTW nice step by step way for New Linux users to understand.
And the Sorry must be accepted. :)
Tefl E Maktab
-----------------------------
----- ----- ----- ------ ------ -------
sarthor
Battalion Quarter Master Havaldaar
 
Posts: 241
Joined: Wed Dec 24, 2003 2:36 am
ICQ: 163419827
Website: http://amazai.net
WLM: sarthor@hotmail.com
Yahoo Messenger: baidaraka@yahoo.com
Location: Pukhtoonistan

Postby Siraj Ahmed » Sat Feb 10, 2007 9:03 pm

Arrow [img] Assalam o Alykum ,
Sub dosto aur bhaiyon ko mera salam mera senerio ye hai

ab masla ye howa hai k pehley tou squid on ho rahi thee
lekin ab wo bhi Failed ka error dey rahi hai

1. mera internet connect hai windows 2000 Professional per Santic
Isdn k throug jis k lan card ki ip hai 192.168.0.1

2. meri linux ki machine per Red Hat Enterprize 3 installed hai 2 lan
card k sath. eth0=192.168.0.2 and eth1= 10.0.0.1
eth0 connected hai Windows Professional k sath (with net sharing)
eth1 connected hai client k sath.

mai jo kar chuka ho uski tafsil nechey hai

a> DHCPD configured hai
b> Squid ki basic configuration kar chuka hoo
c> Swap directory creat hai

lekin client side perr net nahi chal raha hai
Siraj Ahmed
Lance Naik
 
Posts: 25
Joined: Thu Dec 08, 2005 10:22 pm
WLM: sscable@hotmail.com
Yahoo Messenger: sscable2002@yahoo.com
AOL: New+Karachi
Location: New Karachi

Postby sarthor » Sat Feb 10, 2007 9:53 pm

Salam O Alykum,
Dear Siraj Rora.
Paste here squid error, then some one can help you.
tail -f /var/whereisyoursquid-log
Allah Hafiz
Tefl E Maktab

-----------------------------

----- ----- ----- ------ ------ -------
sarthor
Battalion Quarter Master Havaldaar
 
Posts: 241
Joined: Wed Dec 24, 2003 2:36 am
ICQ: 163419827
Website: http://amazai.net
WLM: sarthor@hotmail.com
Yahoo Messenger: baidaraka@yahoo.com
Location: Pukhtoonistan

Postby [-RHEL-] » Sun Feb 11, 2007 4:57 pm

AOA
try this....

1. 1st You install Your Linux Redhat enterprise 4

2 . eth0: IP:192.168.0.2
3. eth1: IP: 10.0.0.1
eth0 connected to internet and eth1 connected to local lan

Server Configuration
Step #1 : Squid configuration so that it will act as a transparent proxy
Step #2 : Iptables configuration
a) Configure system as router
b) Forward all http requests to 3128 (DNAT)

First, Squid server installed (use up2date squid) and configured by adding following directives to file:

# vi /etc/squid/squid.conf
________________________________
Modify or add following squid directives:

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src 10.0.0.1-10.0.0.20
http_access allow localhost
http_access allow lan
________________________________
Where
httpd_accel_host virtual: Squid as an httpd accelerator.
httpd_accel_port 80: 80 is port you want to act as a proxy.
httpd_accel_with_proxy on: Squid act as both a local httpd accelerator and as a proxy.
httpd_accel_uses_host_header on: Header is turned on which is the hostname from the URL.
acl lan src 10.0.0.1-10.0.0.20: Access control list, only allow LAN computers to use squid.
http_access allow localhost: Squid access to LAN and localhost ACL only
http_access allow lan: — same as above –
__________________________________
Output

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl purge method PURGE
acl CONNECT method CONNECT
cache_mem 1024 MB
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl lan src 10.0.0.1-10.0.0.20
http_access allow localhost
http_access allow lan
http_access deny all
http_reply_access allow all
icp_access allow all
visible_hostname myclient.hostname.com
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/spool/squid
__________________________________
Iptables configuration
Next, I had added following rules to forward all http requests (coming to port 80) to the Squid server port 3128

iptables -t nat -A PREROUTING -i eth1 -p tcp –dport 80 -j DNAT –to 192.168.0.2:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128
__________________________________

Best Regard
SroNey
[-RHEL-]
Cadet
 
Posts: 9
Joined: Fri Jan 19, 2007 7:24 am
WLM: sroney_lee@hotmail.com
Location: Lahore

Postby Siraj Ahmed » Tue Feb 13, 2007 11:14 pm

Assalam o Alikum
sub doston ka shukria jinhoney meri thread ka reply diya
lekin masla mera wahi ka wahi hai es mai aap logo ka koi
kasoor nahi mai hi aap logo ki baat ko sahi tour nahi samajh paraha
ho

MASLA :- ye jo doston ney iptables k jo rules diye hai wo jab mai apply
karta ho tou messeage aata hai k ye rules match nahi hoty

windows ki machine k lan card mai TCP mai mainey sirf ye
kiya hai

IP= 192.168.0.1
sn= 255.255.255.0

Q k meri lunux ki machine per bhi browsing nahi ho rahi kya
masla ho sakta hai please reply karain SHUKRIYA


mai Karachi mai rehta hoo
Siraj Ahmed
Lance Naik
 
Posts: 25
Joined: Thu Dec 08, 2005 10:22 pm
WLM: sscable@hotmail.com
Yahoo Messenger: sscable2002@yahoo.com
AOL: New+Karachi
Location: New Karachi

Postby sarthor » Wed Feb 14, 2007 12:49 am

Salam O Alykum,
Please try to post your errors here,

#route -n

what it says?
Allah Hafiz
Tefl E Maktab

-----------------------------

----- ----- ----- ------ ------ -------
sarthor
Battalion Quarter Master Havaldaar
 
Posts: 241
Joined: Wed Dec 24, 2003 2:36 am
ICQ: 163419827
Website: http://amazai.net
WLM: sarthor@hotmail.com
Yahoo Messenger: baidaraka@yahoo.com
Location: Pukhtoonistan

Postby puppy_196 » Fri Mar 02, 2007 6:35 am

AsaLaM~O~AlaiKuM

Yeh Sab Tu Windows 2000 kay baray main hay. Mujhay Xp ki 2 pcs ki networking karni hay. Yeah Cross Over cable ka kia chakkar hay.

1st. I have a cross cable, n i found the color coding from the net as below,



Image


Now i tried many options including givving ip adresses to both pcs i.e

PC-1
IP Adress: 192.168.0.1
Sub Mask: 255.255.255.0
G/Way : ------------- Also tried 192.168.0.2
P DNS Sr : -------------- Also tried 192.168.0.2

PC-2
IP Adress: 192.168.0.2
Sub mask: 255.255.255.0
G/Way: 192.168.0.1
Prefferd DNS server : 192.168.0.1


Also tried building a small office/home network but invain.
But
with these settings
when i connect these pcs thoruh a switch and patch/straight cable it worked for me. i can access net n file sharing 4rm other pc.

Dont know what is the problem with cross over cable or there is a step probably i m missing ....
I get the error network cable unplugged with crossover cable.

i have to do the networking of two pcs without router/switch/hub.

If anyone knows plz tell me whether its a networking fault or cables fault...
puppy_196
Cadet
 
Posts: 2
Joined: Mon Aug 21, 2006 2:12 am


Return to “%s” Installation

Who is online

Users browsing this forum: No registered users and 2 guests

cron