M
M
Maxim2014-08-30 01:04:31
linux
Maxim, 2014-08-30 01:04:31

Why doesn't routing work on Centos 6.5?

There are 3 interfaces.
2 interfaces look to the local area and to different networks. And one tunnel for vpn.
this machine is configured as a gateway gateway
routing table

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.214.2.128    *               255.255.255.128 U     0      0        0 eth0
192.168.3.0     *               255.255.255.0   U     0      0        0 tun0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth1

[[email protected] ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr D6:A6:10:6E:5B:CD
          inet addr:10.214.2.134  Bcast:10.214.2.255  Mask:255.255.255.128
          inet6 addr: fe80::d4a6:10ff:fe6e:5bcd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47019 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9264537 (8.8 MiB)  TX bytes:2562 (2.5 KiB)
          Interrupt:247

eth1      Link encap:Ethernet  HWaddr 22:08:20:6B:A8:4F
          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2008:20ff:fe6b:a84f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:781662 errors:0 dropped:0 overruns:0 frame:0
          TX packets:82721 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:334648846 (319.1 MiB)  TX bytes:13030236 (12.4 MiB)
          Interrupt:246

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:192.168.3.1  P-t-P:192.168.3.1  Mask:255.255.255.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:67 errors:0 dropped:0 overruns:0 frame:0
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:8000 (7.8 KiB)  TX bytes:12690 (12.3 KiB)

forwarding enabled
[[email protected] ~]# cat /proc/sys/net/ipv4/ip_forward
1

I can't ping 192.168.1.1 from 192.168.3.2
The given node is not reachable. if you ping 192.168.1.5, the ping passes, since this is the gateway address on eth1 and therefore the routes are correct.
on 192.168.1.1 there is a reverse route to the network 192.168.3.0
What should I do and what is the problem?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
S
Sergey Petrikov, 2014-08-30
@maxpointn2point

Ask the right question, get the answer. How many gateways do you have? If one does not need to do anything at all, just enable traffic forwarding in the system, if not, steer through the routing tables. Nat is a common rule for masquerading, the Internet is full of examples, what's the problem? If you want with examples - describe the task, psychics, as always, are on vacation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question