UDP and source port

UDP and source port

Post by Stephan Eichl » Tue, 19 Jun 2001 17:22:43



Hi anybody,
is there a way to set the source port of an UDP packet manually? What
function can I use in C/C++?

Regards,
Stephan

 
 
 

UDP and source port

Post by Michael Fu » Tue, 19 Jun 2001 21:28:57



> is there a way to set the source port of an UDP packet manually? What
> function can I use in C/C++?

Call bind() before sending the data.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

 
 
 

UDP and source port

Post by Stephan Eichl » Wed, 20 Jun 2001 18:11:27




> > is there a way to set the source port of an UDP packet manually? What
> > function can I use in C/C++?

> Call bind() before sending the data.

There is now way without bind?
 
 
 

UDP and source port

Post by Michael Fu » Wed, 20 Jun 2001 23:44:58





> > > is there a way to set the source port of an UDP packet manually? What
> > > function can I use in C/C++?

> > Call bind() before sending the data.

> There is now way without bind?

You could use a raw socket and build the packet yourself, but that
might require more work than calling bind() and it usually requires
root privileges.

Is there some reason you don't want to call bind()?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

 
 
 

UDP and source port

Post by Stephan Eichl » Thu, 21 Jun 2001 16:27:30






> > > > is there a way to set the source port of an UDP packet manually? What
> > > > function can I use in C/C++?

> > > Call bind() before sending the data.

> > There is now way without bind?

> You could use a raw socket and build the packet yourself, but that
> might require more work than calling bind() and it usually requires
> root privileges.

> Is there some reason you don't want to call bind()?

No, but I thought there was another way! I thought I just have to use
bind() when I want to listen on a specific port for incoming packets.
But anyway, it works!
Thanks!
 
 
 

1. Ignore all incoming udp/ip and udp/ip on all ports, except open ports?

Hey,
    I want to set my linux box up such that it will not even admit
that it exists (Stealth, if you will) on ports that are not open for
connections.  Port 79 (Finger) for instance, I ran  port scanner on my box
and it responded that the machine exists, and the port is closed.
Is there a to get it to not respond (ignore) incoming connections
altogether?

Also, it is running as a webserver / router / firewall.
I would also like to bind certain services to net devices like
FTP to eth1, so I can access them on my VPN, but not from the
outside eth0.  Is that possible?

If anyone has any ideas I would be most appreciative,
maybe direct me to the appropriate HOWTO?

Thanks,
       Genesis

2. Mandrake 6.1 Laptop Network Install Woes

3. ipchains/TCP/UDP, Why should I open UDP ports so that my TCP ports can work?

4. loadlin fails - 9000h -> 9ffffh problem

5. Unknown outgoing udp source port 38208-38212 traffic

6. question on log entry

7. UDP source port number when using RAW socket??

8. does anyone know how to run 'apache' as a non-root user?

9. Question about setting TCP/UDP source port

10. source and destination ports in udp

11. UDP source port number when using RAW socket??

12. source and destination ports in udp

13. How to limit source port range for UDP broadcasts?