LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-13-2015, 11:56 AM   #1
igor012
Member
 
Registered: Feb 2010
Posts: 89

Rep: Reputation: 2
Why can't I access the server in the other network different ip class.


Hello,

We have two subnets connected to a core-switch.
Code:
Network 1 : 192.168.1.0/24
Network 2 : 10.1.1.0/24
The ip forwarding between those two networks is done by the core-switch.

The main issue we are encountering is that the dns server is not accessible from any computer in the network 2. But every other server is.
Code:
dns-server (Linux) 
eth0 : 192.168.1.1 (default gateway 192.168.1.254)
eth1: 10.1.1.10 (static route 10.1.1.0/24 via 10.1.1.1 dev eth1)
When pinging from network2 the dns server (by name) it tries to reach the 192.168.1.1 interface but I get no reply.

Here is a part of the tcpdump command ran on the dns.

Code:
tcpdump -vv -i eth0 -e icmp
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
17:44:09.536119 00:04:96:6d:16:f6 (oui Unknown) > 00:14:5e:19:cd:0f (oui Unknown), ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 63, id 49422, offset 0, flags [DF], proto ICMP (1), length 84)
    pc1.company.com > dns.company.com: ICMP echo request, id 3635, seq 1, length 64
17:44:10.536080 00:04:96:6d:16:f6 (oui Unknown) > 00:14:5e:19:cd:0f (oui Unknown), ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 63, id 49904, offset 0, flags [DF], proto ICMP (1), length 84)
    pc1.company.com > dns.company.com: ICMP echo request, id 3635, seq 2, length 64
17:44:13.281088 40:f2:e9:6c:84:b8 (oui Unknown) > 00:14:5e:19:cd:0f (oui Unknown), ethertype IPv4 (0x0800), length 590: (tos 0xc0, ttl 64, id 1091, offset 0, flags [none], proto ICMP (1), length 576)
The packets arrive on eth0.

How can I forward them to the other interface (eth1) and get the reply?

I have tried many iptables rules, and still I don't manage to make it work?

Any ideas ?

Thank you
 
Old 11-13-2015, 03:15 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,118

Rep: Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258
What's the output of "route -n"?
 
Old 11-13-2015, 03:21 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,118

Rep: Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258
When you send a packet from 10.1.1.x, the switch forwards it to 192.168.1.1. The server sees it, processes it and sends the reply to 10.1.1.x. Because you have two network cards, the reply goes out eth1 with the src address 10.1.1.10. Your host at 10.1.1.x is waiting for a reply from 192.168.1.1 so it doesn't match.

By having both the switch and the server on both networks you have created a routing loop. Just disable eth1 on the server.
 
Old 11-16-2015, 11:11 AM   #4
igor012
Member
 
Registered: Feb 2010
Posts: 89

Original Poster
Rep: Reputation: 2
Hello,
We managed to make it work, setting the net.ipv4.conf.ethX.rp_filter to zero.
Code:
sysctl -a | grep -i "eth.\.rp_fil"
net.ipv4.conf.eth0.rp_filter = 0
net.ipv4.conf.eth1.rp_filter = 0
 
  


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
Why can't we access a protected member in a derived class by a base class's object? Aquarius_Girl Programming 5 02-04-2012 11:35 PM
when i connect server i have to access entire lan network of server saravanakumar Linux - Networking 2 07-29-2011 02:03 AM
Moved from a class C to Class B network - Performance hit? pkraus109 Linux - Networking 6 01-06-2010 01:16 PM
Can I access class A and class C ip address using one ethernet card? fakhrul Linux - Networking 4 10-21-2007 02:34 AM

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

All times are GMT -5. The time now is 11:59 AM.

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