由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - linux routing table question from dummy
相关主题
网络设置问题xterm got kill when i run my application, how come ?
请问怎么获取pptp拨号后的子网?Ubuntu: internet works throught terminal, not from firefox?
is this legal: can still ping eth1 through eth0, even if eth1 cable is unpluggedWhich DNS server are you using?
won't take the eth0 config from /etc/network/interaces[求助]ICS无法访问citicards.com
2 default gateway when have 2 eth interfaces为什么resolv.conf总被复原
dns-nameservers field in /etc/network/interface请问网络高手
fedora DHCP problem问个远程唤醒机器的问题
stack smashing detected用ubuntu问题集锦
相关话题的讨论汇总
话题: eth0话题: pc1话题: pc2话题: uml话题: ip
进入Linux版参与讨论
1 (共1页)
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 !

1 (共1页)
进入Linux版参与讨论
相关主题
用ubuntu问题集锦2 default gateway when have 2 eth interfaces
请教kickstart自动安装linux的问题dns-nameservers field in /etc/network/interface
求助:ubuntu9.04 无线wpa上网失败fedora DHCP problem
求助:ubuntu上不了网(非无线)stack smashing detected
网络设置问题xterm got kill when i run my application, how come ?
请问怎么获取pptp拨号后的子网?Ubuntu: internet works throught terminal, not from firefox?
is this legal: can still ping eth1 through eth0, even if eth1 cable is unpluggedWhich DNS server are you using?
won't take the eth0 config from /etc/network/interaces[求助]ICS无法访问citicards.com
相关话题的讨论汇总
话题: eth0话题: pc1话题: pc2话题: uml话题: ip