LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-07-2010, 05:15 AM   #1
hikmatrusiwa
LQ Newbie
 
Registered: May 2010
Posts: 5

Rep: Reputation: 0
How to Relay UDP broadcast using Netcat/Socat ?


Hi guys,

I am new to netcat/socat. Here is my problems :

I have two networks :

1. LAN (10.1.x.x subnet 255.255.0.0), and
2. my internet public (IP 202.xx.xxx.xxxx subnet 255.255.255.240)

I have an application in my LAN PC (10.1.2.240) which broadcast udp packet to its client. The client in my LAN can receive the udp packet, no problem.

My question is how netcat/socat can RELAY the udp broadcast packet to one of my IP public address so the message can be received by other client from internet ?

Thank You in Advance.
 
Old 05-08-2010, 09:06 PM   #2
paranoidx
LQ Newbie
 
Registered: Jul 2006
Posts: 24

Rep: Reputation: 3
all broadcast is stopped by your router, can't imagine what the internet will be like if its not.

So your client from the internet has to participate in your LAN, so use VPN.
 
Old 05-09-2010, 10:01 PM   #3
hikmatrusiwa
LQ Newbie
 
Registered: May 2010
Posts: 5

Original Poster
Rep: Reputation: 0
OK, thank you for the reply...

Please enlightment me more here. So i guess i must bind my udp broadcast to one of my ip public server and create vpn server there. And my client should use vpn client to access the broadcast ?

Any idea of how to that ? or is there any links/tutorial i could read regarding the matter?

Regards,
 
Old 05-10-2010, 09:03 AM   #4
paranoidx
LQ Newbie
 
Registered: Jul 2006
Posts: 24

Rep: Reputation: 3
Reading your question carefully, I notice your public ip subnet is .240 which suggest to me to be a broadcast domain and not a point to point link. So my question is, what is the boundary of your broadcast(broadcast domain)? i.e. is the client machine ip 202.x.x.x/28? or anywhere from the internet?

The difference is that all broadcast are stopped by the broadcast domain(router interface/vlans), so say from your question you have 2:

10.1.x.x/16 (private ethernet LAN) < will never get routed to the internet
202.x.x.x/28 (ISP given/provided) < restricted within 202.x.x.x/28

if say I broadcast from a machine within in your LAN say, ip 10.1.0.10, then all machine other than the source port(or 10.1.0.10 in this case) will receive that message i.e. all the 10.1.x.x machines within your LAN.

if say I broadcast from the router/linux(with modem builtin/attached/DMZ), then all the computers with ip 202.x.x.x/28 will receive the message.

so if you simply wanted to broadcast within 202.x.x.x/28, then you don't need VPN (unless ISP block). But on the other hand if you want any computer on the internet to receive this broadcast then you would require VPN server.

Quote:
Originally Posted by hikmatrusiwa
Any idea of how to that ? or is there any links/tutorial i could read regarding the matter?
Most modern SOHO router also have VPN configuring within its settings, so you can start to look in there first. There are alot of information on linux VPN, I simply googled linux VPN open a couple of pages and found this:
http://articles.techrepublic.com.com...1-6038003.html

but be warned this is a very simple implementation and alot aspect has not been taken in consideration. You are opening a service on the internet, so make sure you read up as much information as you can especially the security considerations before you do any hands-on.

Once a computer participate in your LAN, its as if they are connected to your switch locally, so they can access any of your local shared services. The complexity of VPN depends on your needs and security consideration, so you have to read it up if you want to dwell on it.
 
Old 05-10-2010, 07:13 PM   #5
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
I got the impression that he is asking if anyone knows how to pick up a broadcast and send it to a specific IP address. I don't know how to do it with nc, but you could use DNAT in iptables to redirect the initial broadcast. The main issue will be that the client you DNAT from will not get the packet.
 
Old 08-06-2010, 04:14 AM   #6
hikmatrusiwa
LQ Newbie
 
Registered: May 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Hi guyz,

Thank you all for the further explanation. Btw, i have successfully setup VPN server and my client can access the the broadcast after they login using vpn connections.

Btw, now i am moving to another solution : Using Multicast.

If broadcast is forbidden to go out my ISP, how about multicast ? how can i bind my public IP address to become member of multicast ? so that client from internet (not only within my domain) can receive the packet ?
 
  


Reply



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
netcat or socat expert needed wgcampbell Linux - Networking 5 03-01-2010 12:39 PM
UDP Broadcast Issue raviskar Linux - Networking 2 02-06-2009 07:48 AM
broadcast using udp kingraja84 Programming 1 05-23-2007 05:59 AM
UDP broadcast receiver estratos Programming 1 03-14-2007 07:58 AM
Generating UDP data gram using netcat mohtasham1983 Linux - Networking 3 02-19-2007 03:47 AM

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

All times are GMT -5. The time now is 07:13 PM.

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