w*s 发帖数: 7227 | 1 Hi I have pc1(10.50.181.51),
it's running uml (192.117.1.6),
and pc2 (10.50.181.67)
pc1 and pc2 can ping each other,
pc1 and uml can ping each other.
But uml cannot reach pc2.
Any hints pls ?
---- pc1 ----
#netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
192.117.1.6.sta * 255.255.255.255 UH 0 0 0
tap0
10.50.180.0 * 255.255.252.0 U 0 0 0
eth0
link-local * 255.255.0.0 U 0 0 0
eth0
default 10.50.183.254 0.0.0.0 UG 0 0 0
eth0
---- uml ----
[root@localhost ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
10.50.0.0 * 255.255.0.0 U 0 0 0
eth0
link-local * 255.255.0.0 U 0 0 0
eth0
192.117.0.0 * 255.255.252.0 U 0 0 0
eth0
[root@localhost ~]#
---- pc2 ----
netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
10.50.180.0 * 255.255.252.0 U 0 0 0
eth0
default 10.50.183.254 0.0.0.0 UG 0 0 0
eth0 |
j*a 发帖数: 14423 | 2 pc2 does not hv route back to uml
【在 w*s 的大作中提到】 : Hi I have pc1(10.50.181.51), : it's running uml (192.117.1.6), : and pc2 (10.50.181.67) : pc1 and pc2 can ping each other, : pc1 and uml can ping each other. : But uml cannot reach pc2. : Any hints pls ? : ---- pc1 ---- : #netstat -r : Kernel IP routing table
|
S*A 发帖数: 7142 | 3 most likely you need to enable route forwarding.
check your /proc/sys/net/ipv4/ip_forward
If it is 0, set that to 1. |
j*a 发帖数: 14423 | 4 good point.
is there NAT by default for uml?
【在 S*A 的大作中提到】 : most likely you need to enable route forwarding. : check your /proc/sys/net/ipv4/ip_forward : If it is 0, set that to 1.
|
w*s 发帖数: 7227 | 5 tried that on pc1, no help.
i'm very dummy on networking, help are very appreciated.
when i type "iptables -L", tables are empty, i just did what u said, why ?
am i understanding this correctly: ip forwarding is for traffic from
different network, pc1 and pc2 have similar address, they should be in the
same network. uml is in pc1, then should be the same network as well ?
【在 S*A 的大作中提到】 : most likely you need to enable route forwarding. : check your /proc/sys/net/ipv4/ip_forward : If it is 0, set that to 1.
|
x**m 发帖数: 941 | 6 PC2不知道去192.117.0.0的路由,它的默认路由(10.50.183.254)好像也不知道。从UML出来的包到了PC2以后,不知道怎么返回。
我同意joa同学的意见,应该在默认路由或者PC2上添加一条:
$ sudo route add -net 192.117.0.0 netmask 255.255.0.0 gw 10.50.181.51 |
w*s 发帖数: 7227 | 7 问个傻问题,pc2的netstat是这样,
10.50.180.0 * 255.255.252.0 U 0 0 0 eth0
default 10.50.183.254 0.0.0.0 UG 0 0 0 eth0
这里*是什么意思?
10.50.18.0这一类地址在自己的network里,不需要gateway就可以直接通过
switch连接到?比如pc1?
如果我从pc2去www.yahoo.com,那才需要第二行的10.50.183.254,从那里访问外部网
络。
我的背景是写c程序,炒股票和打餐馆,对网络不通。
谢谢各位大侠! |
w*s 发帖数: 7227 | 8 那还要不要iptables ?
我的理解是iptables是封掉一些traffic,
如果完全开放,是不是pc2不用设ip fowarding了?
从UML出来的包到了PC2以后,不知道怎么返回。
【在 x**m 的大作中提到】 : PC2不知道去192.117.0.0的路由,它的默认路由(10.50.183.254)好像也不知道。从UML出来的包到了PC2以后,不知道怎么返回。 : 我同意joa同学的意见,应该在默认路由或者PC2上添加一条: : $ sudo route add -net 192.117.0.0 netmask 255.255.0.0 gw 10.50.181.51
|
x**m 发帖数: 941 | 9 先把iptable里面和firewall有关的暂时关掉。SSA提示的ip forwarding选项,如果默
认没有打开的话,应该在PC1里面配置。PC2应该不需要和ip forwarding相关的设置。 |
a9 发帖数: 21638 | 10 如果要用它做路由,就需要开
【在 w*s 的大作中提到】 : 那还要不要iptables ? : 我的理解是iptables是封掉一些traffic, : 如果完全开放,是不是pc2不用设ip fowarding了? : : 从UML出来的包到了PC2以后,不知道怎么返回。
|
w*s 发帖数: 7227 | 11 a9, do u happen to know this,
if uml is running on pc1,
is it treating pc1 as router,
or it's like another pc in the network as pc1/pc2 ?
uml is using tap0/tun, i have no idea about these.
Thanks a lot !
【在 a9 的大作中提到】 : 如果要用它做路由,就需要开
|
w*s 发帖数: 7227 | 12 it works, 多谢各位好人!
从UML出来的包到了PC2以后,不知道怎么返回。
【在 x**m 的大作中提到】 : PC2不知道去192.117.0.0的路由,它的默认路由(10.50.183.254)好像也不知道。从UML出来的包到了PC2以后,不知道怎么返回。 : 我同意joa同学的意见,应该在默认路由或者PC2上添加一条: : $ sudo route add -net 192.117.0.0 netmask 255.255.0.0 gw 10.50.181.51
|
v*****r 发帖数: 1119 | 13 looks like pc1 acts as router for uml, but not sure
Co-ask
【在 w*s 的大作中提到】 : a9, do u happen to know this, : if uml is running on pc1, : is it treating pc1 as router, : or it's like another pc in the network as pc1/pc2 ? : uml is using tap0/tun, i have no idea about these. : Thanks a lot !
|