LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-25-2003, 01:16 PM   #1
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
Unhappy Internet Sharing & nic bridge?




Ilustration:

Internet
||
||
eth0
Linux RH 8.0 (with 3 nic)
|| \\
|| eth2 (192.168.0.2) <=> Win 2k (192.168.0.10)
||
eth1(192.168.0.3) <=> Win 2k (192.168.0.70)


Internet sharing and everything else works on eth1 & eth2
(this is done with a iptable script)

Now I Want the 2 win2k to be connected like if the linux pc hade been a switch (or hub). I can see each win2k computer in the others network workgroup but i cant connect. I cant ping either (192.168.0.10 to 192.168.70, vice versa).


[Old problem was that I couldnt ping (etc.) 192.168.0.70 from linux.]

Last edited by darchon; 03-28-2003 at 12:40 PM.
 
Old 03-25-2003, 01:34 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
How does the 'route' result from the Linux machine look like? I guess you need to use a command similar to 'route add -host target interface', but I'd like to be sure.
 
Old 03-25-2003, 01:38 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It is a routing problem - all 192 trafic will be being sent out of eth1. The "route" command will let you see the routing table. You can then use "route add -host 192.168.0.10 dev eth1".

Note: this will be lost on reboot - you may want to put it in a startup script.
 
Old 03-25-2003, 01:50 PM   #4
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
Yes it helped alot... thanks guys.. (or girls)
 
Old 03-26-2003, 05:46 AM   #5
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
hmm i still cant ping from one win2k to the other...

i can see them in the workgroup but i cant connect
 
Old 03-26-2003, 12:32 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You probably don't have IP forwarding enabled - try:
echo "1" > /proc/sys/net/ipv4/ip_forward
 
Old 03-26-2003, 12:34 PM   #7
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
nope didnt help...
I have done that already!

but thanks for reply!
 
Old 03-27-2003, 02:03 PM   #8
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Originally posted by darchon
hmm i still cant ping from one win2k to the other...

i can see them in the workgroup but i cant connect
Could you copy the error message you get when you try to ping from one Win2k to another?
 
Old 03-27-2003, 02:11 PM   #9
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
No... because this morning I reinstalled rh 8
and now I cant get the nic's to work...

I use 3 nic's
eth0 = realtech 8139
eth1 = realtech 8139
eth2 = 3com 905b

I think It has to do with the fact that there are 2 identical nic's (using 8139too.o)

Please tell me if i should post more info!

Last edited by darchon; 03-27-2003 at 02:13 PM.
 
Old 03-27-2003, 07:48 PM   #10
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
Now i got it working again..

not the connection between w2k <-> w2k but internetsharing works fine

when I ping it just say "...Timeoute"
 
Old 03-27-2003, 08:12 PM   #11
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
Tihs is my firewall script.. should i enter something to allow everything betveen eth1 & eth2 (lan)

Code:
echo -e "\n\nLoading simple rc.firewall...\n"

IPTABLES=/sbin/iptables
DEPMOD=/sbin/depmod
INSMOD=/sbin/insmod

EXTIF="eth0"
INTIF="eth1"
INTIF2="eth2"
echo "   External Interface:  $EXTIF"
echo "   Internal Interface:  $INTIF"
echo "   Internal Interface:  $INTIF2"

echo -en "   loading modules: "

echo "  - Verifying that all kernel modules are ok"
$DEPMOD -a

echo "----------------------------------------------------------------------"
echo -en "ip_tables, "
$INSMOD ip_tables

echo -en "ip_conntrack, "
$INSMOD ip_conntrack

echo -en "ip_conntrack_ftp, "
$INSMOD ip_conntrack_ftp

echo -en "ip_conntrack_irc, "
$INSMOD ip_conntrack_irc

echo -en "iptable_nat, "
$INSMOD iptable_nat

echo -en "ip_nat_ftp, "
$INSMOD ip_nat_ftp

echo -e "ip_nat_irc"
$INSMOD ip_nat_irc

echo "----------------------------------------------------------------------"
echo -e "   Done loading modules.\n"

echo "   Enabling forwarding.."
echo "1" > /proc/sys/net/ipv4/ip_forward

echo "   Enabling DynamicAddr.."
echo "1" > /proc/sys/net/ipv4/ip_dynaddr

#-----------------------------------------------------------------
#Clearing any previous configuration
#
#  Unless specified, the defaults for INPUT and OUTPUT is ACCEPT
#    The default for FORWARD is DROP (REJECT is not a valid policy)
#------------------------------------------------------------------
echo "   Clearing any existing rules and setting default policy.."
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT

#-----------------------------------------------------------------
#Clearing any previous configuration
#
#  Unless specified, the defaults for INPUT and OUTPUT is ACCEPT
#    The default for FORWARD is DROP (REJECT is not a valid policy)
#------------------------------------------------------------------
echo "   Clearing any existing rules and setting default policy.."
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F

#$IPTABLES -t nat -A PREROUTING -p tcp -i eth2 --dport 80 -j DNAT --to-destination 192.168.0.10:80
#$IPTABLES -A FORWARD -i eth2 -p tcp -d 192.168.0.10 --dport 80 -j ACCEPT

echo "   FWD: Allow all connections OUT and only existing and related ones IN"
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF2 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF2 -o $EXTIF -j ACCEPT

$IPTABLES -A FORWARD -j LOG

echo "   Enabling SNAT (MASQUERADE) functionality on $EXTIF"
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

echo -e "\nrc.firewall-2.4 v$FWVER done.\n"
Suggestions???
I am a Noob so if u see something in there u feel I should change, dont hesitate. Post!

I would also want to know what im doing wrong, not geting the forwarding of port 80 to my http server (192.168.0.10) (about line 20 from the bottom in the script)

Code:
Here are my route table:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.10    *               255.255.255.255 UH    0      0        0 eth2
192.168.0.70    *               255.255.255.255 UH    0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2
130.239.145.0   *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         130.239.145.1   0.0.0.0         UG    0      0        0 eth0

Last edited by darchon; 03-28-2003 at 05:50 AM.
 
Old 03-28-2003, 12:16 PM   #12
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
The route:
Code:
192.168.0.10    *               255.255.255.255 UH    0      0        0 eth2
Should use eth1 (this should help the port 80 problem too)
and im not quite sure what these are doing
Code:
192.168.0.70    *               255.255.255.255 UH    0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2

Last edited by david_ross; 03-28-2003 at 12:17 PM.
 
Old 03-28-2003, 12:24 PM   #13
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
ohh... sorry forgot to change the info in the first post...

I have changed the configuration a bit...

now i have edited the first post so that it should be up2date to

Last edited by darchon; 03-28-2003 at 12:43 PM.
 
Old 03-28-2003, 12:43 PM   #14
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
In that case use eth0
In the routing table you are saying to access 192.168.0.10 use eth2 but 192.168.0.10 is attached to eth0. You will need to do this for both green NICs.
 
Old 03-28-2003, 12:49 PM   #15
darchon
Member
 
Registered: Mar 2003
Location: Storuman@Sweden
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
no... *check the first post*
internet is connected to eth0
192.168.0.70 is connected to eth1
192.168.0.10 is connected to eth2

evrything works exept for portforwarding and connectivety 192.168.0.10 <==> 192.168.0.70
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.10    *               255.255.255.255 UH    0      0        0 eth2
192.168.0.70    *               255.255.255.255 UH    0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2
130.239.145.0   *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         130.239.145.1   0.0.0.0         UG    0      0        0 eth0

Last edited by darchon; 03-28-2003 at 12:52 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
internet connection sharing through bridge positiveinflux Linux - Networking 6 04-03-2007 11:16 PM
Sharing internet & file system between Windows98 & Redhat9 cjs_pro Linux - Networking 2 07-15-2004 07:25 AM
Internet Connection Sharing In SUSE 9.1 Personal with SIngle NIC ikm19 Linux - Networking 4 06-24-2004 11:25 AM
internet sharing pppoe using 1 nic problem bashrc2 Linux - Networking 2 02-06-2004 04:17 AM
1 nic internet and file sharing ciberrust Linux - Networking 2 12-28-2003 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:19 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
Open Source Consulting | Domain Registration