linux新手求关于两台linux机器的网线直连问题

永恒中的瞬间 2013-12-09 10:54:45
有两台机器 A是用虚拟机搭载的Ubuntu系统 B机器是直接装的SUSElinux 想通过A与B之间不走外网,直接连接一根网线实现连接。
A的ifconfig参数:
eth0 Link encap:Ethernet HWaddr 00:0c:29:1c:06:3b
inet addr:202.199.118.120 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1c:63b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3371 errors:0 dropped:0 overruns:0 frame:0
TX packets:1396 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:317963 (317.9 KB) TX bytes:152369 (152.3 KB)
Interrupt:19 Base address:0x2024
B的ifconfig参数:
eth0 Link encap:Ethernet HWaddr 00:0c:29:1c:06:3b
inet addr:202.199.118.187 Bcast:202.199.118.255 Mask:255.255.255.128
inet6 addr: fe80::ea06:88ff:feca:90ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3371 errors:0 dropped:0 overruns:0 frame:0
TX packets:1396 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:317963 (317.9 KB) TX bytes:152369 (152.3 KB)
Memory:8b300000-8b320000
前面尝试过修改
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 202.199.118.120
netmask 255.255.255.0
gatway 202.199.118.12

vi /etc/resolv.conf
# Generated by NetworkManager
nameserver 202.199.118.1
nameserver 202.199.118.2
然后尝试成功连接过
后来机器断了次电,然后就连接不上了,小弟刚接触linux不久,弄了好久未果,求高手帮忙

...全文
811 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
践行见远 2013-12-09
  • 打赏
  • 举报
回复
楼上说的极是,你的一个掩码是255.255.255.0,一个是255.255.255.128 两个不在同一网段的地址怎么可能直连通
Jerning 2013-12-09
  • 打赏
  • 举报
回复
我建議你的b機的netmask返回/24應該就可以通了!
Jerning 2013-12-09
  • 打赏
  • 举报
回复
是不是你的網關問題呀? 你覺得/31的202.199.118.120和~~~~~~~~~~~.187在同網段?

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧