LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2024, 12:27 AM   #1
Woutlaw
LQ Newbie
 
Registered: Aug 2021
Posts: 7

Rep: Reputation: Disabled
Linux Yocto UDP Port Forwarding


Hello,

New to learning Linux, I have a data aggregator/cell router and I want to setup UDP port forwarding. I want to access multiple devices behind the cell router via one IP address. For example, I want to be able to go to a web browser and type in XXX.XXX.XXX.XXXublic port and access web interface of a local device behind the router. I've done this before a while back but didn't take notes. Attached is the .sh file I'm looking to edit, any guidance will be appreciated.

Last edited by Woutlaw; 02-07-2024 at 06:36 PM.
 
Old 02-07-2024, 05:09 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,138
Blog Entries: 6

Rep: Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827
You made a pdf with an image, with text that cant be copied? Of a bash script?

Post stuff like that between code tags
Code:
#!/bin/bash

if [ "$#" -ne 3 ]; then
    echo "Add port forwarding to IPtables for 30 minutes"
    echo "Usage $0 <listen port> <IP Address of device> < device port"
    exit -1
fi

iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A PREROUTING -p udp -d 10.0.1.34 --dport $1 -j DNAT --to-destination $2:$3
 
  


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
[SOLVED] UDP port forwarding doesn't work danielhilst Linux - Networking 4 04-19-2012 03:48 PM
cisco 2600 and UDP port forwarding fritz001 Linux - Networking 2 02-19-2012 03:37 PM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
udp port forwarding to ip range oddo Linux - Networking 0 10-04-2004 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:11 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