Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My main aim is to run client server applications written for TCP on linux (RHEL 6.3, 2.6.x kernel) hosts with dual NIC. One of the NIC is assigned IP Address so that i can ssh into it and the second NIC is connected via cross over cable to another similar configuration linux box. The intention is to use NIC with cross over cable for performance testing. Below is the configuration, where eth3 is connected to cross over cable. Since it has no IP, i am not sure how to run my client server application. The configuration was done by server admin and i am hoping someone can guide me if the below settings are inadequate and i need to request an IP assigned to eth3.

When i do ifconfig -a, i see the eth3 NIC,but since it has no IP, how can my client connect to it and what IP:Port do i specify for server to bind to?

eth2      Link encap:Ethernet  HWaddr 4C:4B:93:6G:98:EE  
      inet addr:127.122.148.2  Bcast:167.132.248.31  Mask:255.255.255.224
      inet6 addr: fe80::3e4a:92ff:fe6f:99ee/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:346598515 errors:0 dropped:0 overruns:0 frame:0
      TX packets:205832922 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:404093955155 (376.3 GiB)  TX bytes:44013461721 (40.9 GiB)

eth3      Link encap:Ethernet  HWaddr 3D:4B:82:6E:98:F3  
      BROADCAST MULTICAST  MTU:1500  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:1000 
      RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

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:708365224 errors:0 dropped:0 overruns:0 frame:0
      TX packets:708365224 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:1439201391376 (1.3 TiB)  TX bytes:1439201391376 (1.3 TiB)
share|improve this question
    
Why don't you just assign it an IP address and then add a route to 127.122.148.2 on the other machine? –  David Schwartz Apr 17 '13 at 16:13

2 Answers 2

up vote 1 down vote accepted

Yes, it can, but you need to assign it an address yourself. Since this is a point-to-point link, it's very suitable for RFC 1918 addresses. So pick a subnet out of that space, allocate two addresses from that, and give one to each end of the link.

For example, you could use 10.0.0.0/24, make one end 10.0.0.1 and the other end 10.0.0.2. Or use 172.31.254.0/24, make one end 172.31.254.1, and the other end 172.31.254.2. Getting name resolution to work is a separate problem, but each end of the cable will then have an address, and will know the address by which to refer to the other end.

share|improve this answer
    
+1 for referring to RFC1918. Thank you!! –  Jimm Apr 17 '13 at 16:21
    
For your future-self... don't hardcode the application IP... –  cpt_fink Apr 18 '13 at 4:20

Q: Can you assign an ip address to a NIC connected by a crossover cable?

A: Yes you can.

Both hosts connected by the crossover cable need to have an ip address in the same subnet on the NIC connected by the crossover cable in order to communicate with each other through those NIC's.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.