Sunteți pe pagina 1din 4

signup

SuperUserisaquestionandanswersiteforcomputerenthusiastsandpowerusers.It's100%free,noregistrationrequired.

connectingtwolinuxpcsviacrosscable

IwantconnectmytwoLinuxPCsrunningin2.6kernelviacrossovercable.TodothisIhavedonethefollowingsettingsaftera
Googlesearch:
InPC1
1.

ifconfigeth010.10.11.16netmask255.255.255.0up

2.

routeadddefaultgw10.10.11.13eth0(defaultgatewaywhichisipofpc2)

InPC2
1.

ifconfigeth010.10.11.13netmask255.255.255.0up

2.

routeadddefaultgw10.10.11.16eth0(defaultgatewaywhichisipofpc1)

Thenitriedpingingicouldnotabletoconnect.Aretheseabovesettingsenoughoranythingamimissing?
Foryourmoreinformation
InPC1
ifconfigoutput
eth0Linkencap:EthernetHWaddr00:16:76:A1:33:37
inetaddr:10.10.11.16Bcast:10.10.11.255Mask:255.255.255.0
inet6addr:fe80::216:76ff:fea1:3337/64Scope:Link
UPBROADCASTMULTICASTMTU:1500Metric:1
RXpackets:49984errors:6dropped:0overruns:0frame:6
TXpackets:17221errors:0dropped:0overruns:0carrier:0
collisions:439txqueuelen:1000
RXbytes:14295749(13.6MiB)TXbytes:2684625(2.5MiB)
loLinkencap:LocalLoopback
inetaddr:127.0.0.1Mask:255.0.0.0
inet6addr:::1/128Scope:Host
UPLOOPBACKRUNNINGMTU:16436Metric:1
RXpackets:511errors:0dropped:0overruns:0frame:0
TXpackets:511errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:62780(61.3KiB)TXbytes:62780(61.3KiB)

routenoutput
DestinationGatewayGenmaskFlagsMetricRefUsIface
10.10.11.00.0.0.0255.255.255.0U000eth0
169.254.0.00.0.0.0255.255.0.0U100200eth0
0.0.0.010.10.11.130.0.0.0UG000eth0

InPC2
ifconfigoutput
eth0Linkencap:EthernetHWaddr00:40:CA:A1:C7:1B
inetaddr:10.10.11.13Bcast:10.10.11.255Mask:255.255.255.0
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:705errors:0dropped:0overruns:0frame:0
TXpackets:97errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:63557(62.0KiB)TXbytes:9973(9.7KiB)
Interrupt:11Baseaddress:0xa000
loLinkencap:LocalLoopback
inetaddr:127.0.0.1Mask:255.0.0.0
UPLOOPBACKRUNNINGMTU:16436Metric:1
RXpackets:112errors:0dropped:0overruns:0frame:0

login

tour

help

Signup

TXpackets:112errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:12400(12.1KiB)TXbytes:12400(12.1KiB)

routenoutput
DestinationGatewayGenmaskFlagsMetricRefUseIface
10.10.11.00.0.0.0255.255.255.0U000eth0
0.0.0.010.10.11.160.0.0.0UG000eth0
linux

editedMay5'11at14:32
Majenko
22.1k

migratedfromstackoverflow.comMay5'11at12:39
Thisquestioncamefromoursiteforprofessionalandenthusiastprogrammers.

4 Itisunnecessary(andwrong)tohaveeachPCasgatewayoftheother(it'slikeaninfiniteloop).Areyou
surethecableworks?Doyouseethelightattheethernetport?Itispossiblethatthemachinesarenot
respondingtopingorthatonepc(orboth)hasafirewall?CarlosCampderrsMay5'11at11:53
ThanksforyourquickreplyCarlos,Cableisworkingbecauseitestedthatcablewithwindowsmachineand
onelinuxmachine.Cableisblinkingatboththeends.Andalsofirewallisnotblocking.Ihaveremovedone
gatewayfromonemachinethenalsoiamnotabletopingYuvarajMay5'11at12:17
MostDistrosrunafirewallbydefaultthesedays...TurboJMay5'11at22:17

3Answers

IconnectedtwoFedoramachines.Here,IusedAandBasthemachinenames.

Step1:
EditFile
vim/etc/sysconfig/networkscripts/ifcfgeth0

andenterdetailsformachineA
DEVICE="eth0"
HWADDR="<MachineANICHWADDRCANBEENTEREDUSINGifconfig>"
BOOTPROTO="static"
ONBOOT="yes"
NM_CONTROLLED="yes"
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.1
BROADCAST=192.168.1.255
IPV4_FAILURE_FATAL=yes
IPV6INIT=no

Step2:
EditFile
vim/etc/sysconfig/networkscripts/ifcfgeth0

andenterdetailsformachineB
DEVICE="eth0"
HWADDR="<MachineBNICHWADDRCANBEENTEREDUSINGifconfig>"
BOOTPROTO="static"
ONBOOT="yes"
NM_CONTROLLED="yes"
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.2
BROADCAST=192.168.1.255
IPV4_FAILURE_FATAL=yes
IPV6INIT=no

askedMay5'11at11:41
Yuvaraj

34

61

123

Step3:
ConnectbothmachineswithanEthernetcrossovercable.

Step4:
Optionalreboot.

Step5:
ping192.168.1.1frommachineBand ping192.168.1.2frommachineA

Followingarethestepsincaseifyouarestillnotabletoping.Itmightbepossiblethat
becauseofthenetworkcard'sspeeddifferenceyourmachinesarenotabletoping.Setboth
machines'speedtoconstant.Thenitmightwork.
OnMachineAentercommand:
ethtoolseth0speed10duplexhalf
OnMachineBentercommand:
ethtoolseth0speed10duplexhalf

ThenrepeatStep5.Ifyourmachinesarestillnotabletopingeachotherthendothefollowing:
[root@localhostravidborse]#lspci
00:00.0Hostbridge:IntelCorporationMobile915GM/PM/GMS/910GMLExpressProcessor
toDRAMController(rev03)
00:02.0VGAcompatiblecontroller:IntelCorporationMobile915GM/GMS/910GML
ExpressGraphicsController(rev03)
00:02.1Displaycontroller:IntelCorporationMobile915GM/GMS/910GMLExpress
GraphicsController(rev03)
00:1b.0Audiodevice:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)High
DefinitionAudioController(rev03)
00:1d.0USBController:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)USB
UHCI#1(rev03)
00:1d.1USBController:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)USB
UHCI#2(rev03)
00:1d.2USBController:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)USB
UHCI#3(rev03)
00:1d.3USBController:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)USB
UHCI#4(rev03)
00:1d.7USBController:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)USB2
EHCIController(rev03)
00:1e.0PCIbridge:IntelCorporation82801MobilePCIBridge(revd3)
00:1f.0ISAbridge:IntelCorporation82801FBM(ICH6M)LPCInterfaceBridge(rev
03)
00:1f.2IDEinterface:IntelCorporation82801FBM(ICH6M)SATAController(rev03)
00:1f.3SMBus:IntelCorporation82801FB/FBM/FR/FW/FRW(ICH6Family)SMBus
Controller(rev03)
06:08.0Ethernetcontroller:RealtekSemiconductorCo.,Ltd.RTL8139/8139C/8139C+
(rev10)
06:09.0CardBusbridge:TexasInstrumentsPCI7420CardBusController
06:09.2FireWire(IEEE1394):TexasInstrumentsPCI7x201394a2000OHCITwoPort
PHY/LinkLayerController
06:09.3Massstoragecontroller:TexasInstrumentsPCI7420/7620ComboCardBus,
1394a2000OHCIandSD/MSProController
06:0a.0Networkcontroller:IntelCorporationPRO/Wireless2200BG[Calexico2]
NetworkConnection(rev05)

Checkwhichdriversareloadedindmesg|grepEthernetlsmod|grep8139
Ienteredthe

lspcicommandandlookedatwhichEthernetcontrollerisusingyourmachines.

MyAMachineisusing RTL8101E/8102Eandabove lspcioutputisofMachineB.Download


therespectiveLinuxdriversfortheEthernetcardandinstallthem.Thesedriversareveryeasy
toinstall.Readthe readmeinthedriver'sfolder.
editedMar24'12at16:33
slhck
108k

answeredMar24'12at12:38
ravidborse

28

251

306

56

Theconfigurationthatyouhavedoneappearstobecorrect,althoughitisnotneccesarytoset
eachPCasthegatewayoftheother,thePCjustneedtobeonthesameLANforittowork.

Maybeit'saproblemwithyoucable.
Ifyournetworkcardshaveautosensingcapabilities,anyregularcableofcrossovercablewill
work(forthatreasonyourtestwiththeWindowsPCwork)butiftheylackthisfunctionthen
youhavetouseacrossovercableandaregularUTPcablewillnotwork.
answeredMar24'12at17:36
jhcaiced
1,235

youdon'tneedarouteorangatewayifthehostsareinthesamesubnet(whichisthecasein
yourexample)Soremovetheroutesandrestarttheroutingdaemon(orrestartnetwork
service)
Ifthatstilldoesn'twork:maybetherecouldbeanproblemwithspeednegotiationlookatthe
outputofethtool:
$ethtooleth0

useethtooltochangeduplex,speedandothersettings.Allthoessettingsshouldbethesame
onbothsystems
answeredMay5'11at12:17
TheBndr
113

S-ar putea să vă placă și