LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-11-2014, 08:28 AM   #1
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 270

Rep: Reputation: 33
unable to get default ip address for interface connected back to back


I am in need of running a server and client in same computer on two different interfaces connected back to back using raw ethernet sockets.

one interface is normal one fixed inside and another interface is usb based external NIC.

"cat /etc/network/interfaces" is as follows:

Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.100

auto eth1
iface eth1 inet static
address 192.168.1.200
if i keep the above configuration, networking is not getting enabled at all.
instead if I comment out last three lines (for eth1 which is external usb nic), I am seeing eth1 is showing up but not acquiring any ip address, also I am not seeing packets are going out on the wire.

Can some one plz help me in fixing the issue.

My requirements are as follows:

1. I need to connect both the interfaces back to back, boot the computer.
2. Both the interfaces should come up with ip address.
3. I should be able to run client on one interface and server on another interface.

Can some one please help me in configuring my computer so that i can achieve all the above three.
 
Old 08-11-2014, 08:35 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,325

Rep: Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919
is this related:
http://www.linuxquestions.org/questi...6/#post3804866
 
Old 08-11-2014, 10:04 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Is there a reason you can't just use the loopback interface to communicate between your server and client? Server listens for connections on port, say, 9000, and the client connects to 127.0.0.1:9000 to open the connection. I don't see why you need two NICs for this, unless there's something I'm missing.
 
Old 08-24-2014, 12:12 AM   #4
solarisguy
Member
 
Registered: Aug 2010
Location: Seattle
Distribution: CentOS, RHEL, Oracle Enterprise Linux, Solaris, BSD
Posts: 64

Rep: Reputation: 21
If the client and server need to be running on the same system, you can also share the same physical interface and use a sub interface/alias.

Code:
ifconfig eth0 192.168.1.100/24
ifconfig eth0:1 192.168.1.200/24
Or to create a persistent subinterface, use the following in /etc/network/interfaces:

Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.100

auto eth0:1
iface eth0:1 inet static
address 192.168.1.200
 
Old 08-24-2014, 11:50 PM   #5
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 270

Original Poster
Rep: Reputation: 33
I am in need of running server and client on two different interfaces in the same machine only.
Because I will be connecting some network components like routers / switches etc to these interfaces.
 
Old 08-25-2014, 03:02 AM   #6
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 270

Original Poster
Rep: Reputation: 33
in this setup, I am able to open the raw sockets and also able to bind them to the interface.
But write function is failing with error ENETDOWN i.e., "Network is down"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Xubuntu 14.04 - Default panel removed. I Can't return it back to default mode. Jader Linux - Newbie 3 05-16-2014 10:50 AM
Minicom not working I connected linux machines back-to-back Prabhunath Linux - Networking 2 06-30-2010 04:39 AM
Switch back to graphical interface revenge80200 Linux - Newbie 5 06-02-2004 07:41 PM
How do I get my GUI interface back during boot up? Nihen Linux - Software 5 04-16-2004 11:49 PM
Loop back Interface siddiqu Linux - Networking 2 11-17-2001 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration