LinuxQuestions.org
Review your favorite Linux distribution.
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 05-24-2010, 02:23 AM   #1
oferprtz
LQ Newbie
 
Registered: May 2010
Posts: 2

Rep: Reputation: 0
RHEL5 - Can't make ETH1 to work properly


Hi Guys,

I have a problem with new installed machine.
i have installed RHEL5 2.6.18-92.el5xen kernel and configured 2 network cards.

DEVICE=eth0
BOOTPROTO=static
#HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
NETWORK=192.168.6.0
NETMASK=255.255.255.0
IPADDR=192.168.6.51
TYPE=Ethernet

DEVICE=eth1
BOOTPROTO=static
#HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
NETWORK=192.168.9.0
NETMASK=255.255.255.0
IPADDR=192.168.9.19
TYPE=Ethernet

and this is my route:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 eth1
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 192.168.6.1 0.0.0.0 UG 0 0 0 eth0

/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=test-p05
GATEWAY=192.168.6.1


when i ping to the network .9 (as for the eth1) i receive:

[root@test-P05 network-scripts]# ping 192.168.9.100
PING 192.168.9.100 (192.168.9.100) 56(84) bytes of data.
From 192.168.9.19 icmp_seq=2 Destination Host Unreachable
From 192.168.9.19 icmp_seq=3 Destination Host Unreachable
From 192.168.9.19 icmp_seq=4 Destination Host Unreachable


and ping to network .6 (as for the eth0) is working:

root@test-P05 network-scripts]# ping 192.168.6.50
PING 192.168.6.50 (192.168.6.50) 56(84) bytes of data.
64 bytes from 192.168.6.50: icmp_seq=1 ttl=64 time=1.29 ms
64 bytes from 192.168.6.50: icmp_seq=2 ttl=64 time=0.129 ms
64 bytes from 192.168.6.50: icmp_seq=3 ttl=64 time=0.134 ms



moreover, my ip6tables, iptables are disabled.
selinux = disabled
firewall down.

please help.

thanks,
ofer.
 
Old 05-24-2010, 03:04 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by oferprtz View Post
Hi Guys,

I have a problem with new installed machine.
i have installed RHEL5 2.6.18-92.el5xen kernel and configured 2 network cards.

DEVICE=eth0
BOOTPROTO=static
#HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
NETWORK=192.168.6.0
NETMASK=255.255.255.0
IPADDR=192.168.6.51
TYPE=Ethernet

DEVICE=eth1
BOOTPROTO=static
#HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
NETWORK=192.168.9.0
NETMASK=255.255.255.0
IPADDR=192.168.9.19
TYPE=Ethernet

and this is my route:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 eth1
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 192.168.6.1 0.0.0.0 UG 0 0 0 eth0

/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=test-p05
GATEWAY=192.168.6.1


when i ping to the network .9 (as for the eth1) i receive:

[root@test-P05 network-scripts]# ping 192.168.9.100
PING 192.168.9.100 (192.168.9.100) 56(84) bytes of data.
From 192.168.9.19 icmp_seq=2 Destination Host Unreachable
From 192.168.9.19 icmp_seq=3 Destination Host Unreachable
From 192.168.9.19 icmp_seq=4 Destination Host Unreachable


and ping to network .6 (as for the eth0) is working:

root@test-P05 network-scripts]# ping 192.168.6.50
PING 192.168.6.50 (192.168.6.50) 56(84) bytes of data.
64 bytes from 192.168.6.50: icmp_seq=1 ttl=64 time=1.29 ms
64 bytes from 192.168.6.50: icmp_seq=2 ttl=64 time=0.129 ms
64 bytes from 192.168.6.50: icmp_seq=3 ttl=64 time=0.134 ms



moreover, my ip6tables, iptables are disabled.
selinux = disabled
firewall down.

please help.

thanks,
ofer.

Code:
vi /etc/sysctl.conf

set net.ipv4.ip_forward = 1 if not already done.

then run

Code:
sysctl -p
You will need to turn on iptables to route between the different networks with rules similar but not necessarily the same as these

Code:
# iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
# iptables --append FORWARD --in-interface eth1 -j ACCEPT
 
Old 05-24-2010, 03:30 AM   #3
oferprtz
LQ Newbie
 
Registered: May 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by centosboy View Post
Code:
vi /etc/sysctl.conf

set net.ipv4.ip_forward = 1 if not already done.

then run

Code:
sysctl -p
You will need to turn on iptables to route between the different networks with rules similar but not necessarily the same as these

Code:
# iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
# iptables --append FORWARD --in-interface eth1 -j ACCEPT

Hi Centosboy,

Thanks for the quick reply.
ive tried your advice but its still can't ping to .9 network.
ive also tried to restart the network and ive noticed that its setting the ip_forward to 0 again:

[root@test-P05 ~]# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

[root@test-P05 ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0
[ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
[root@test-P05 ~]#

any idea?
 
Old 05-24-2010, 09:06 AM   #4
yadava
Member
 
Registered: Apr 2008
Posts: 60

Rep: Reputation: 15
Smile

hi

try this setting

first please remove GATEWAY setting from /etc/sysconfig/network

then in each eth0 and eth1 file add gateway entry for their subnets.
then turn on ipforwarding permanently (net.ipv4.ip_forward = 1)
then do route add.
 
  


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
Make the power button work properly without ACPI Lord Estraven *BSD 3 01-01-2010 10:17 PM
howto install YUM and make it run properly in RHEL5? harry2006 Linux - Software 7 09-25-2008 01:12 AM
Can't make eth1 work.... or even exists... everal Slackware 3 10-08-2006 11:41 AM
Laptop and extrenal monitor. How can I make it work properly? kimothy Linux - Hardware 2 01-07-2006 11:49 PM
Can't make the wu-ftpd work properly ivannus Linux - Networking 8 06-27-2001 03:58 PM

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

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