LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 10-22-2004, 03:10 PM   #1
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 63
network not recognizing new node.


Hello All. Just went out and got a laptop today, and I am trying to install gentoo on it but I cannot get the networking to work. First of all, here is a crude ascii map of the network:
Code:
                                         | to internet
 Server:                              |
                              eth0     |  public IP
            ----------------------------------------------------
eth1      |  192.168.0.1                                      eth2  |  192.168.0.3
            |                                                                |
            |                                                                |
workstation 192.168.0.2                                    laptop 192.168.0.4
Before was only the server and workstation, which has worked fine. Today I added the laptop and configured it to be 192.168.0.4 and use 192.168.0.3 as the default gw. All the interfaces are physically installed and up and running, but I cannot ping from server to laptop or vice versa.

Servers ifconfig is:
Code:
eth0      Link encap:Ethernet  HWaddr 00:40:F4:5D:76:10
          inet addr:[x.x.x.x edited]  Bcast:255.255.255.255  Mask:255.255.252.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:622933 errors:0 dropped:0 overruns:0 frame:0
          TX packets:594974 errors:0 dropped:0 overruns:0 carrier:0
          collisions:4029 txqueuelen:1000
          RX bytes:431501388 (411.5 Mb)  TX bytes:222592242 (212.2 Mb)
          Interrupt:9 Base address:0xb00

eth1      Link encap:Ethernet  HWaddr 00:40:F4:39:9D:90
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:427589 errors:0 dropped:0 overruns:0 frame:0
          TX packets:476408 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:58318191 (55.6 Mb)  TX bytes:426609509 (406.8 Mb)
          Interrupt:5 Base address:0x2a00

eth2      Link encap:Ethernet  HWaddr 00:50:BF:A2:62:3F
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5348 (5.2 Kb)  TX bytes:336 (336.0 b)
          Interrupt:11 Base address:0xf800
Servers route is:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2
x.x.x.0             *               255.255.252.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         x.x.x.x              0.0.0.0         UG    0      0        0 eth0
Ifconfig of laptop is:
Code:
eth0      Link encap:Ethernet  HWaddr 00:0F:B0:01:EF:AD
          inet addr:192.168.0.4  Bcast:255.255.255.255  Mask:255.255.252.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:480 (480.0 b)  TX bytes:7708 (7.5 Kb)
          Interrupt:11 Base address:0xa000
route of laptop is:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         192.168.0.3   0.0.0.0             UG    0      0        0 eth0
The server runs a NAT firewall for the workstation, so I basically doubled the rules for the laptop. I am not sure if this is the correct way to do this though. The new firewall script is:
Code:
EXTIF="eth0"
INTIF="eth1"
NBIF="eth2"

EXTIP="x.x.x.x"
INTNET="192.168.0.0/24"
INTIP="192.168.0.1"
NBIFIP="192.168.0.3"
UNIVERSE="0.0.0.0/0"
NBIP="192.168.0.4"

$IPTABLES -P INPUT DROP
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT DROP
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -F -t nat

$IPTABLES -X
$IPTABLES -Z

# INPUT chain
$IPTABLES -A INPUT -i eth1 -s 192.168.0.2 -d $UNIVERSE -j ACCEPT
$IPTABLES -A INPUT -i eth2 -s 192.168.0.4 -d $UNIVERSE -j ACCEPT
$IPTABLES -A INPUT -i $EXTIF -s $INTNET -d $UNIVERSE -j DROP
$IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP -m state --state \
          ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -s $UNIVERSE -d $UNIVERSE -j DROP

# OUTPUT chain
$IPTABLES -A OUTPUT -o lo -s $UNIVERSE -d $UNIVERSE -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF -s $EXTIP -d $INTNET -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF -s $INTIP -d $INTNET -j ACCEPT
$IPTABLES -A OUTPUT -o $NBIF -s $EXTIP -d $NBIP -j ACCEPT
$IPTABLES -A OUTPUT -o $NBIF -s $NBIFIP -d $NBIP -j ACCEPT
$IPTABLES -A OUTPUT -o $EXTIF -s $UNIVERSE -d $INTNET -j DROP
$IPTABLES -A OUTPUT -o $EXTIF -s $EXTIP -d $UNIVERSE -j ACCEPT
$IPTABLES -A OUTPUT -s $UNIVERSE -d $UNIVERSE -j DROP

# FORWARD chain
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state \
       ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -i $EXTIF -o $NBIF -m state --state \
        ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $NBIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -j DROP

# NAT table
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP
Does someone know what I am missing, or have any troubleshooting tips? When I plug the laptop in place of the workstation it can connect to the net fine so I think the problem is with the NAT iptable rules.
 
Old 10-22-2004, 03:33 PM   #2
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA Approx. N 36°36.434' W 79°24.342' Accur. 100' or so.
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,245

Rep: Reputation: 161Reputation: 161
This doesn't look correct to me anyway.

inet addr:192.168.0.4
Bcast:255.255.255.255
Mask:255.255.252.0

The broadcast and net mask look off. I might be wrong, but shouldn't the net mask be

Mask:255.255.255.0

good luck.
 
Old 10-22-2004, 03:39 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Original Poster
Rep: Reputation: 63
That's a typo, sorry. I cut and paste the output of ifconfig on the server's eth0 and changed the values to that of the laptop, but forgot those ones. The *real* ifconfig of the laptop is:
Code:
eth0      Link encap:Ethernet  HWaddr 00:0F:B0:01:EF:AD
          inet addr:192.168.0.4  Bcast:192.168.0.255 Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:480 (480.0 b)  TX bytes:7708 (7.5 Kb)
          Interrupt:11 Base address:0xa000
 
Old 10-22-2004, 03:44 PM   #4
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA Approx. N 36°36.434' W 79°24.342' Accur. 100' or so.
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,245

Rep: Reputation: 161Reputation: 161
Well that looks good, you say you can plug the laptop in place of the workstation, and the connection is fine. If that's the case does the laptop retain it's xxx.xxx.xxx.4 address? If so, have you tried switching cables?
good luck.
 
Old 10-22-2004, 03:49 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Original Poster
Rep: Reputation: 63
Ok I got it. I ran this command on the server:
Code:
# route add -host 192.168.0.4  dev eth2
Both workstation and laptop are NATed and connected to the internet. I guess before the packets for the laptop were being sent to the workstation because the device for 192.168.0.0 network was set on eth1.

Thanks PEACEDOG...
 
Old 10-22-2004, 03:52 PM   #6
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA Approx. N 36°36.434' W 79°24.342' Accur. 100' or so.
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,245

Rep: Reputation: 161Reputation: 161
Glad you got it sorted, but, I can't take any credit. Good on you mate for sorting it yourself.
 
Old 10-23-2004, 05:33 PM   #7
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
The main problem here is that both eth1 and eth2 on the server reside on the same network. Without this special routing rule the kernel can't deside where to send the packets, since there are two separate destinations.

This newly added route get precedence before the more general routes from the original configuration.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hp open hp openView node network manager...? shahg_shahg Linux - Networking 1 06-30-2005 03:23 PM
How to be a leaf node of an IRC network ? freelinuxcpp Linux - Networking 2 08-04-2004 09:14 AM
Recognizing network names ivanatora Linux - Networking 4 10-03-2003 02:19 AM
Recognizing a PDC - hypothetical network itsjustme Linux - Networking 6 10-02-2003 12:53 AM
Independent Linux Network node on a NT2000 Network? rioguia Linux - Networking 4 08-15-2002 08:38 AM


All times are GMT -5. The time now is 04:37 PM.

Main Menu
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
Open Source Consulting | Domain Registration