Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Inferfaces one netmask

Status
Not open for further replies.

Stkcode

Technical User
Jan 8, 2002
4
0
0
US
Hello all,

I have a bit of a networking problem. One ethernet card appears to be routing to the second lan card. I have 3 ethernet cards, two for the internet and one for the lan.

They are setup as the following:

Eth0 – 67.115.71.218/255.255.255.248
Eth1 – 67.115.71.221/255.255.255.248
Eth2 – 192.168.1.100/255.255.255.0

I’ve done an “ifconfig” and “lspci” and everything is setup correctly.
Whenever I call 67.115.71.218 (eth0), I’m getting routed to 67.115.71.221 (eth1).

I believe my problem lies in the Kernel IP routing table.
When I do a “route –n”, I get the following:


Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
67.115.71.216 0.0.0.0 255.255.255.248 U 0 0 0 eth1
67.115.71.216 0.0.0.0 255.255.255.248 U 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 67.115.71.217 0.0.0.0 UG 0 0 0 eth0


This is obviously wrong. An “ip route show” displays:

67.115.71.216/29 dev eth1 scope link
67.115.71.216/29 dev eth1 proto kernel scope link src 67.115.71.221
192.168.1.0/24 dev eth2 scope link
127.0.0.0/8 dev lo scope link
default via 67.115.71.217 dev eth0


I can do
route del –net 67.115.71.216 netmask 255.255.255.248 dev eth1

Then a
route add –net 67.115.71.216 netmask 255.255.255.248 dev eth0


“ip route show” now shows:

67.115.71.216/29 dev eth0 scope link
67.115.71.216/29 dev eth1 proto kernel scope link src 67.115.71.221
192.168.1.0/24 dev eth2 scope link
127.0.0.0/8 dev lo scope link
default via 67.115.71.217 dev eth0


And “route –n” now shows

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
67.115.71.216 0.0.0.0 255.255.255.248 U 0 0 0 eth0
67.115.71.216 0.0.0.0 255.255.255.248 U 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 67.115.71.217 0.0.0.0 UG 0 0 0 eth0


Still doesn’t set things right…still goes to the second interface, eth1 (67.115.71.221) when ever I try to go to 67.115.71.218 (first interface, eth0)! Any suggestions?

Any help would greatly be appreciated!

Thanks,
Jon


Additional info:

ifconfig shows this:


eth0 Link encap:Ethernet HWaddr 00:A0:CC:69:70:3D
inet addr:67.115.71.218 Bcast:67.115.71.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:991 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:59956 (58.5 Kb) TX bytes:2062 (2.0 Kb)
Interrupt:11 Base address:0x4000

eth1 Link encap:Ethernet HWaddr 00:05:5D:CE:A3:E0
inet addr:67.115.71.221 Bcast:67.115.71.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:981 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:58922 (57.5 Kb) TX bytes:540 (540.0 b)
Interrupt:10 Base address:0xb000

eth2 Link encap:Ethernet HWaddr 00:05:5D:CE:64:35
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:295176 errors:0 dropped:0 overruns:0 frame:0
TX packets:223330 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:204328601 (194.8 Mb) TX bytes:118830662 (113.3 Mb)
Interrupt:12 Base address:0xb000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:948 (948.0 b) TX bytes:948 (948.0 b)

 
Hi there, I also encounter that configuration before where I used PRoxy ARP, to configure my firewall composed of 3 LAN CARDS,; eth0, eth1 eth2 running Linux RH 7.1

eth0 and eth1 uses public IP, and eth2 uses private IP for LAN

IP Configuration
eth0 IP address : 192.168.1.5
Subnet Mask : 255.255.255.128
gateway : 192.168.1.1
eth1 IP Address : 192.168.1.5
Subnet Mask : 192.168.1.5
gateway : 192.168.1.1

eth0 IP address : 192.168.2.1
subnet mask : 255.255.255.0
gateway : 192.168.2.


You have to enable Proxy Arp by adding the foolowing lines to /etc/rc.d/rc.local file.

# SETUP FOR PROXY ARP FIREWALL

echo "1" > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo "1" > /proc/sys/net/ipv4/conf/eth1/proxy_arp

I think I can't explain this to you well so please check the links below. for more details on Proxy Arp

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top