LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-10-2007, 07:36 AM   #1
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Rep: Reputation: 30
pinging 192.168.0.10 from 192.168.2.101


Hi,


I have a Suse Linux box with 2 NICs, eth1 on 192.168.2.x and eth0 with 192.168.0.x

On another machine on the 192.168.2.x network, I need to be able to access 192.168.0.10.

What do I need to set up to do this? Do you achieve this with IPtables?

From what I've read up, the request to ping the 192.168.0.x address is sent to the default gateway which would be my SMC ADSL Modem and router.
 
Old 04-10-2007, 11:15 AM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
You need to use the ROUTE command.

Last edited by Micro420; 04-10-2007 at 11:17 AM.
 
Old 04-11-2007, 09:56 AM   #3
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
First of all you need to tell us how the machines are connected (where is the modem, router, IP subnets etc). If I guess correctly, you need to set IP forwarding between the interfaces with /etc/sysconfig/sysctl option IP_FORWARD="yes" in openSUSE 10.2 (this is probably the default). Depending on the type of traffic you want to route, this may not be enough.
 
Old 04-11-2007, 10:12 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
If you need direct access to 192.168.0.10, you'll need to set up the intermediate machine as an ethernet bridge and put both networks on the 192.168.0.0/16 netblock.
 
Old 04-11-2007, 11:07 AM   #5
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
route add -net 192.168.2.0 netmask 255.255.255.0 eth0

You can also add the 192.168.2.0 network on your adsl router and it should work also.
 
Old 04-12-2007, 01:55 AM   #6
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Yes, okay, here is my setup:

Internet
|
ADSL Modem/Router (192.168.2.1)
|
|-----------------Various Machines (192.168.2.x - DHCP)
|
eth1 on Linux Box (192.168.2.99 - static)
|
eth0 on Linux Box (192.168.0.x - Assigned by DHCP)
|
Mailserver (192.168.0.10 - static)
|
DHCP Server
|
Internet

I have enetered the following command:

>route add -net 192.168.0.0 netmask 255.255.255.0 eth0

(note 192.168.0.0 not 192.168.2.0 as suggested by cereal83 - typo presumed, please confirm)

IP_FORWARD="yes" in Yast.

Still not able to ping 192.168.0.10 from 192.168.2.102

I have been researching how to set up a network bridge as I tend to think that this is the direction to go....
 
Old 04-12-2007, 03:20 AM   #7
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Okay I have found what looks like a relevant Article: http://nepotismia.com/linux/bridge/part2.html

I have used his instructions to generate a br0 interface but now need to set the br0 with ifconfig. Do I have to set a static IP address as Paul Dwerryhouse describes? How does this affect the DHCP server on eth0?

I've just noticed that his example has the bridge connecting two networks both on the 10.1.9.x network. Am I on completely the wrong track?
 
Old 04-12-2007, 07:20 AM   #8
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
I've found more info at: http://tldp.org/HOWTO/Ethernet-Bridg...ter-HOWTO.html

I've set up a small script as follows:
Quote:
#!/bin/sh
brctl addbr br0
brctl stp br0 off
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up
ifconfig br0 192.168.2.99 netmask 255.255.255.0 up
route add default gw 192.168.2.99
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -I FORWARD -j ACCEPT
iptables -I FORWARD -j LOG
iptables -I FORWARD -j DROP
iptables -A FORWARD -j DROP
iptables -x -v --line-numbers -L FORWARD
as once the eth1 went down I would lose contact with my (headless) linux box.

I thought that the script would continue to execute and bring up br0 on 192.168.2.99 which would give me a connection again. However, this does not happen and the linux box remains unresponsive until reboot....
 
Old 04-13-2007, 07:01 AM   #9
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
How is the DHCP server connected to the internet? Does the ADSL router have 2 NICs? If so, you can simply set the router to route the traffic between the 192.168.0.x and 192.168.2.x networks.
If the ADSL router has one interface and is connected to a switch, to which are also connected the linux box and the 192.168.2.x network machines, then all you need for normal traffic (no broadcasts) is to set the ADSL router to route 192.168.0.x traffic to the linux box (eth1).

I think it would be better if you changed the topology like this: connect the linux box to the router (192.168.1.x network on eth0), connect the 192.168.2.x machines to the linux box on eth1 and add another NIC to connect the 192.168.0.x machines (eth3), and IP_FORWARD=1 will be enough for normal traffic to route between the networks. You can also make the linux box the DHCP server for both networks (192.168.2.x and 192.168.0.x) and firewall this way.

The link you provide works for the case that the linux box is the router, which seems that is not the case here, unless you do what I described above.
 
Old 04-13-2007, 07:21 AM   #10
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
The ADSL Router is an SMC ADSL Modem/Router/Switch.

That is it has 4 ethernet ports, an ADSL line out to the telephone jack, and a wirless access point.
 
Old 04-14-2007, 09:00 AM   #11
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
Then you can connect the 192.168.2.x machines on the router, as well as the linux box and set the router to allow routing between the 2 networks. eth0 and eth1 should be set to a 192.168.0.x address respectively. This setup will not allow broadcasts to propagate though, be warned.
 
Old 05-02-2007, 03:08 AM   #12
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
I have tried as you suggested, but am having mixed results.

The Other network I'm trying to connect to has the IP 192.168.0.x and assigns new connections by DHCP.

My SMC Barricade router has 4 ports, each of which can be set to the default LAN or to a VLAN which is defined with the following parameters:

Name: OtherNetwork
IP Adress: 192.168.0.58 (I've specified this IP as I am assuming that the DHCP server allocates in a pool starting at 100 - from observation)
Subnet Mask: 255.255.255.0 (no problems there!)
Nat Domain: Private (the other option is 'Public')
IGMP Snooping: Disabled
IGMP Querier: Disabled

The problem is that once I've set this, wired connection with the router drops off and on randomly and periodically.
 
Old 05-03-2007, 10:21 AM   #13
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
You mean that the physical connection fails? That's a hardware problem, you may contact the manufacturer, update the firmware etc.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
What route to access daisy chained 2d router 192.168.1.1 after 192.168.0.1 (subnets?) Emmanuel_uk Linux - Networking 6 05-05-2006 01:47 AM
Is someone on my network?! ::ffff:192.168.0.10:ssh ::ffff:192.168.0.:38201 ESTABLISHE ming0 Linux - Security 4 04-12-2005 01:04 AM
192.168.2.1 network with 192.168.0.1? Micro420 Linux - Networking 2 02-27-2005 06:59 AM
Iptables is converting -s 192.168.1.0/8 into 192.0.0.0/8 why !? qwijibow Linux - Security 2 01-26-2005 09:57 AM
Debian bound to IP address 192.168.0.101 when connected to D-link wireless router henrylcr Linux - Wireless Networking 4 01-28-2004 05:35 PM

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

All times are GMT -5. The time now is 06:15 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