NETWORK  4

there is a whole class B range of IP addresses reserved for private (LAN) use
which is 192.168.x.x so u can theoretically have up to 65536 comps in a LAN, but
of course some IPs are reserved, such as 192.168.x.0, and 192.168.x.254 is
usually for gateways or who knows what else, and 192.168.x.255 to broadcast to
the whole network. the US Robotics router i have happens to use a fixed 3rd byte
of "123" so my lan can only have 256 (minus the reserved IPs) computers on it.
my 2 comps are 192.168.123.1 and 192.168.123.2, and in a DOS prompt i can type
net send 192.168.123.2 "hello world" (or use any aliases such as Localhost or my
"computer name" in place of the IP of course) from any comp on my lan and it
will pop up a box on my specific computer as long as i have a prog running that
handles "net send" messages. i'm not sure about all the windows OSes but i know
that in win98 the program is called winpopup.exe (if u dont have it u need to go
into Add/Remove Programs in the control panel, go to the Windows Setup tab, and
select WinPopup from Accessories or something) and in winXP they are handled by
Windows Messenger (which is installed and runs as a service by default in
winXP--so people that dont know anything and don't have firewalls, etc can
recieve the popups if they haven't configured Messenger on their pc yet! i used
to get a few spam messages a day when i had my firewall off). ok, so now we know
how to send the messages and what progs recieve them....but remember i said that
the fourth byte of 255 in an IP address broadcasts to the whole network (or the
whole class C that you specify in the 3rd byte)? there u go! try it in
school...get a DOS shell up and type in net send 192.168.x.255 "screw you all"
or something...don't forget the quotes around the text. if u forget the syntax
just type net send help or net send ? and it will tell you. to find out what to
put for the 3rd byte of the IP u could probably type ipconfig in DOS or winipcfg
in windows and look at the 3rd byte of your own IP Address and of the Default
Gateway. if they are different, i would suppose that the Gateway would be the
address for true "broadcasting" i.e. the whole LAN but i don't really know.
oh yeah, by the way, u can send messages to external computers and stuff too,
you're not restricted to sending within your LAN. just use an IP address or
hostname or whatever.

please feel free to correct me in any way...i'm not an expert with LANs or
anything, actually i just figured this out when i got my new comp and got those
spam messages via Windows Messenger ;-)

---------------------------------------------------------------------------------

shouts to Phurien, g3ddylee, tim, demo, all my otha biatchez lol

---------------------------------------------------------------------------------
synERR
aim: synerr1
email: [email protected] 
Now you should be able to understand the image. You see a computer with local IP 10.0.0.1 who is connected to the internet by a telephone line and has achieved an IP number by this ISP (Internet Service Provider) that IP is 11.1.1.4. What does this mean ? If someone on the internet tried to contact 11.1.1.4 they would get a response but if they would try to contact 10.0.0.1 they would not get a response although it is the same computer because the IP 10.0.0.1 isn't recognized worldwide. Then we have 10.0.0.2 till 10.0.0.x who are connected to 10.0.0.1. In this case we could consider 10.0.0.1 as a gateway (a gateway is a sort of exit to another network, a gateway could be a link between 10.0.1.x and 10.0.0.x, but therefore that machine must be recognized by 10.0.1.x and 10.0.0.x or with other words it should have 2 network cards or in this case a modem and a network card). So we could consider it as a gateway but there is one detail, for 10.0.0.1 being a gateway. But it isn't for the simple reason that the internet wouldn't recognize it. 
=> I'm 10.0.0.2 and I want to contact you 
-> I'm 1.2.3.3 and I have now idea how to rreach you, go away (this messages isn't really broadcasted because there is no logical route between the two computers, this is logged) 
So what does masquerading actually do ? Well, it gives its own IP (11.1.1.4 this is the IP that is attached to the ISP, giving by DHCP by exemple) to the entire network and remembers which computer requested which packet. Something like: 
=> I'm 10.0.0.2 and I want to contact 1.2.3.3 
-> I'm 10.0.0.1 and I will be processing yoour request 
-> I'm 14.1.1.4 and I want to contact 1.2.33.3 
_> I'm 1.2.3.3 and awaiting your command 
I hope this cleared out a lot. So a masqueraded server gives its IP ( in facts it masks the ip's of the network) in order for the other pc's to get on the internet. And the incoming data is being filtered under the 10.0.0.x network. 

2 I hate theory I want to type something 

2.1 Preparing your system

I am supposing that you all have a computer with Linux OS installed on it and that you have configured your internet account (if not, check the help pages by your provider). And know some Linux basics like compiling your own kernel. This entire site is only valid if you have a 2.2.x kernel. Because masquerading went thru some changes lately. If you have not got a 2.2.x kernel running, I suggest you upgrade. Because older kernels might contain bugs, might not support your newest hardware and make your system vulnerable to attacks. You can get the latest kernel from ftp.kernel.org (I will explain short the kernel basics here) 
[GoMoRRaH@SaTaN GoMoRRaH]$ mv mykernel.tar.gz /usr/src/ 
[GoMoRRaH@SaTaN GoMoRRaH]$ cd /usr/src 
[GoMoRRaH@SaTaN src]$ rm linux (removes the symbolic link to your old sources) 
[GoMoRRaH@SaTaN src]$ tar -zxvf mykernel.tar.gz 
(your kernel is now being extracted default in the directory linux) 
[GoMoRRaH@SaTaN src]$ cd linux 
[GoMoRRaH@SaTaN linux]$ make menuconfig 
(you can choose, type: make config for text based, type: make menuconfig for graphical and type: make xconfig under X-windows) 
Now you can see all the options you can use, this is different for each system so, * stands for support and M stand for modules, modules are pieces of kernel code that can be compiled in at any time, later on) But however you have to say YES to the following: 
=> Prompt for development and or incomplete code / drivers 
=>Enable loadable module support 
=>Networking support 
=>Network firewalls 
=>TCP/IP Networking 
=>IP:forwarding/gatewaying 
=>IP:firewalling 
=>IP:masquerading 
=>IP:ipportfw masq support 
=>IP:ipautofw masq support 
=>IP:ICMP masquerading 
=>IP:always defragment 
=>Dummy net driver support 
=>IP:ip fwmark masq-forwarding support 

Note that the above options are required for ip masquerading so you still need other codes in your kernel. When you are finished you will be prompted to save changes. The following commands do the actual compiling and may take a from 10 - 40 minutes and will show many characters which you may not understand on your screen, don't worry it is normal. 
[GoMoRRaH@SaTaN linux]$ make dep 
[GoMoRRaH@SaTaN linux]$ make clean 
[GoMoRRaH@SaTaN linux]$ make bzImage 
[GoMoRRaH@SaTaN linux]$ cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel 
[GoMoRRaH@SaTaN linux]$ make modules 
[GoMoRRaH@SaTaN linux]$ make modules_install 
At this point you should edit your /etc/lilo.conf file. You should add something like 
image=/boot/kernel 
label=masqkernel 
root=/dev/hdax (replace this by your root filesystem, harddisk, partition, ..) 
read-only 
This makes your boot manager find your new kernel at boot. So if your see the lilo prompt the next time you should type masqkernel 
[GoMoRRaH@SaTaN linux]$ lilo 
added linux-2.2.5-15 * 
added dos 
added masqkernel 
Now you should edit your /etc/rc.d/rc.local file so the modules needed are automatically loaded at boot 


/sbin/depmode -a 
/sbin/modprobe ip_masq_ftp 
/sbin/modprobe ip_masq_raudio 
/sbin/modprobe ip_masq_irc 


These modules are needed for ftp, real audio and irc. There is only one thing to do besides rebooting and that is enabling your IPV4 forwarding. 
[GoMoRRaH@SaTaN linux] echo "1" > /proc/sys/net/ip_forward(ing) Now you should reboot your system with your newly made kernel, see if everything boots properly, if not you should redo the above steps. Until you have a properly working kernel. 

Start up your masquerade

In fact there isn't much to do once you've got your kernel right. It is a matter of dialing in with you provider, and typing 2 commands. They are used to set your forwarding policies. [GoMoRRaH@SaTaN GoMoRRaH]$ ipchains -P forward DENY 
[GoMoRRaH@SaTaN GoMoRRaH]$ ipchains -A forward -s 10.0.0.0/4 -j MASQ 
In order for this to work on your local network the only thing you have to adjust is the -s parameter. 10.0.0.0 is your network address and the 4 is the highest ip number that is masqueraded. Your server should work now. And yeah, that's really it, you have a lot of theory and a lot of preparation with your kernel and you have to type 2 lines to get your server up and running. 

Configuring your clients

You have a server but what is a server without clients ? What is a supermarket without customers ? Not that you have to do so much configuring no not at all. There is only one little thing that you have to take care of, (if it isn't already done). Your clients should have as a gateway the IP of your masqueraded server (here 10.0.0.1) This is located near your networking options it shouldn't be hard to find. 

3 General 

Other information sources 

If you want to know more about Linux networking or Linux in general you should read documents that are published by the LDP (Linux documentation Project). They have published a Network administrators guide, a system administrators guide, a programmers guide and several HOWTO's. They come with each Linux distribution and are really worth reading. 

Credits 

For any further questions, you can mail GoMoRRaH, a member of Black Sun Research Facility

<< = = BACK

 

Hosted by www.Geocities.ws

1