Problem in eth0 and eth1 sharing internet with other computers


 
Thread Tools Search this Thread
Special Forums IP Networking Problem in eth0 and eth1 sharing internet with other computers
# 1  
Old 05-28-2012
Problem in eth0 and eth1 sharing internet with other computers

hellow everbody.
iam using 32 bit centos 6.2 on my desktop and iam new to linux. i have eth0 and eth1 on my desktop. so i have some problems i have menson here:

i have edited:
Code:
etc/sysctl.conf
net.ipv4.ip_forward = 1

and i have edited iptables too

Code:
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables --append FORWARD --in-interface eth1 -j ACCEPT
# iptables-save


this is my configuration of my desktop:

for eth0
Code:
address            netmask        gateway
10.10.10.101   255.0.0.0       10.10.10.254

dns servers 10.10.10.254

10.10.10.254 is my wireless router given from my isp.

for eth1
Code:
address          netmask            gateway
192.168.1.1   255.255.255.0   10.10.10.101

dns servers 10.10.10.101


i have windows xp installed in my laptop:

local area network:
Code:
address          netmask              gateway
192.168.1.2   255.255.255.0   192.168.1.1

dns servers 192.168.1.1

when i enable eth0 and eth1:
Code:
eth0      Link encap:Ethernet  HWaddr 00:E2:1C:D1:42:A3  
          inet addr:10.10.10.101  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2e2:1cff:fed1:42a3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3058 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3222 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2719502 (2.5 MiB)  TX bytes:430301 (420.2 KiB)
          Interrupt:21 Base address:0xe000 

eth1      Link encap:Ethernet  HWaddr 00:C0:26:75:B2:D7  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2c0:26ff:fe75:b2d7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:676 (676.0 b)  TX bytes:11555 (11.2 KiB)
          Interrupt:22 Base address:0xa000



problem from my desktop (10.10.10.101) enabling eth0 and eth1

when i ping yahoo.com from my desktop (10.10.10.101)
Code:
PING yahoo.com (209.191.122.70) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
From 192.168.1.1 icmp_seq=3 Destination Host Unreachable
From 192.168.1.1 icmp_seq=4 Destination Host Unreachable
From 192.168.1.1 icmp_seq=6 Destination Host Unreachable
From 192.168.1.1 icmp_seq=7 Destination Host Unreachable

i was not able to get reply

when i ping 10.10.10.254. 10.10.10.254 is my wireless router given from my isp.
Code:
$ ping 10.10.10.254
PING 10.10.10.254 (10.10.10.254) 56(84) bytes of data.
64 bytes from 10.10.10.254: icmp_seq=1 ttl=64 time=0.311 ms
64 bytes from 10.10.10.254: icmp_seq=2 ttl=64 time=0.279 ms
64 bytes from 10.10.10.254: icmp_seq=3 ttl=64 time=0.285 ms
64 bytes from 10.10.10.254: icmp_seq=4 ttl=64 time=0.309 ms

i get reply


problem from my laptop or 192.168.1.2
Code:
1 ) while ping 192.168.1.1 (eth1 on desktop) from 192.168.1.2 (from laptop) i get reply.
2 ) i was not able to browse internet form my 192.168.1.2 (laptop)
3 ) but when i disable eth1, i was able to browse internet on my desktop but no connection between eth1 (desktop) and my laptop

while disabling eth1:
Code:
eth0      Link encap:Ethernet  HWaddr 00:E2:1C:D1:42:A3  
          inet addr:10.10.10.101  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2e2:1cff:fed1:42a3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2721 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2817 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2285759 (2.1 MiB)  TX bytes:381862 (372.9 KiB)
          Interrupt:21 

eth1      Link encap:Ethernet  HWaddr 00:C0:26:75:B2:D7  
          inet6 addr: fe80::2c0:26ff:fe75:b2d7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1005 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1025 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:72323 (70.6 KiB)  TX bytes:85135 (83.1 KiB)
          Interrupt:22 Base address:0xc000

ping yahoo.com from my desktop (10.10.10.101)
Code:
PING yahoo.com (98.139.183.24) 56(84) bytes of data.
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_seq=1 ttl=49 time=412 ms
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_seq=2 ttl=49 time=405 ms
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_seq=3 ttl=49 time=396 ms
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_seq=4 ttl=49 time=421 m

iam so confused. what i need is i want to enable eth0 and eth1 and can browse internet from my desktop and can share internet to other laptop through switch.

any kinds of ideas, suggestions and guidelines are welcome and i'll greatful if u let me clear my problem.
THANK YOU IN ADVANCE.
# 2  
Old 05-29-2012
Hi,

did you reboot after editing /etc/sysctl.conf.

Alternatively you could try:
Code:
cat /proc/sys/net/ipv4/ip_forward echo "1"

(no need to reboot for changes taking effect).

You could also stop iptables during troubleshooting (so you don't have to worry about firewall misconfiguration).

Also, please share the output of:
Code:
route -vn

(make sure the default gateway is 10.10.10.254).

see ya
fra
# 3  
Old 05-29-2012
Quote:
Originally Posted by frappa
Hi,
Alternatively you could try:
Code:
cat /proc/sys/net/ipv4/ip_forward echo "1"

That should probably read
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. IP Networking

Why eth1 with auto dhcp disturbs pppoe over eth0?

Hi, I use ubuntu 16.04 desktop with ufw (default setup + 22, 80, 443 ports open). I connect directly to ISP using pppoe over eth0. I also have eth1 which when disabled the websites are accessible in browser. When starting eth1 with auto dhcp the websites are no longer accessible in browser (give... (3 Replies)
Discussion started by: adrhc
3 Replies

2. Red Hat

Dual NICs - When I 'ifup eth1' it replaces eth0

I've got an issue with a VMWare server running RHEL 6.3 that has dual E1000 NICs. I have configured the cards as I would normally do in /etc/sysconfig/network-scripts as ifcfg-eth0 and ifcfg-eth1. I can execute ifup eth0 and bring the interface up quite happily, however when I execute ifup eth1 it... (2 Replies)
Discussion started by: phaedrus
2 Replies

3. Red Hat

Wan on eth1 and Lan on eth0

I have a local network on dev eth0 Server has static IP of 10.0.0.1 Gateway is 10.0.0.1 and Dns is 10.0.0.1 I am using this network for imaging 500 plus computer... Now, Issue that I am having is that I need to update packages and I dont want to change the configuration on eth0 because I... (0 Replies)
Discussion started by: golpemortal
0 Replies

4. Ubuntu

Ubunut iptable not routing trafic between eth1 and eth0

hello, first of all i am new to unix so maybe my problem is very easy for many of you but is very important to me. So the idea is that i want to use a ubuntu 10.4 machine as a router from eth0 to eth1. but the traffic routing is nor working properly i configured the 2 interfaces to be... (2 Replies)
Discussion started by: florin.bv
2 Replies

5. Solaris

Reg- eth0,eth1 (ethernet card)

Hi Guys, I am working as a L-1 support and i want to know that are the precaution need to take on eth0(Ethernet card) i heard on production server it is very much important, what are the steps need to observe on this tickets. (1 Reply)
Discussion started by: kurva
1 Replies

6. UNIX for Dummies Questions & Answers

controlling traffic source from NIC eth0, eth1 in Linux

Hi Guys, is there a way to send traffic coming from the source iface (eth0, eth1)? i need to test traffic that will come from both eth0 and eth1 from a Linux box. Thanks, Martin (0 Replies)
Discussion started by: mdap
0 Replies

7. Red Hat

ifcfg-eth0 and eth1 is N/A

when i finish installed rhel 4.4 to my hp dl585 box, ifcfg-eth0 and ifcfg-eth1 is not available.when i ifconfig -a,i can not see the eth0 and eth1, only lo0 and si0. Unlike to the other server i found eth0 and eth1 files in /etc/sysconfig/network-scripts/. what will i do? (2 Replies)
Discussion started by: kenshinhimura
2 Replies

8. IP Networking

two computers one internet

i have a computer (sempron 2200+) with Suse 9.3 and another computer with windows 98 (PI 233 Mhz). I'm connect first computer (with Suse) on the Internet through ethernet but second computers in not connect. How can connect second computers on the internet (with 3 network card...two on the first... (8 Replies)
Discussion started by: dragos
8 Replies

9. UNIX for Dummies Questions & Answers

Internet sharing

I wanted to share internet with my Server running Win 2000 and client on Solaris 8. I networked them with a hub and 2 NICs on Server. Is there any software to share the internet? Need help!!!!!!!!!! Thanks... Praveen (5 Replies)
Discussion started by: praveenk
5 Replies
Login or Register to Ask a Question