GLneo wrote:so i could just set the IP to anything and packets would just make it to my emulated OS somehow ?
Not quite so. Every computer in a TCP/IP network is configured to have at least the following three pieces of information: IP-address, network-mask, and default-gateway. There could be more than one default gateway, or there could be none (standalone network not connected to others), but you can get pretty far ignoring those.
Now, in the Internet, every IP address is given by the god's of internet for you to use. It's typically divided to small blocks and those divided futher and futher and so on, as people create sub-networks and sub-sub-networks and so on, and there's a lot of interesting stuff going on. You can also ignore most of that stuff, until you want to start routing packets yourself.
When a normal person connects his PC to the internet, there are a few possibilities. She could get a static IP/netmask/gateway from her ISP. Or her ISP could just tell her to use DHCP. Most operating systems will configure by DHCP unless you tell them not to, but you can always set the settings manually, and when you don't have a DHCP server somewhere, you have to. Now whether the IP came by paper or automatically by DHCP, it can be either a public IP, which your ISP got from the gods of internet, or it could be a private IP, because when the internet was created, the gods were wise and reserved some addresses for all kinds of private networks.
There are three such blocks. One is 10.x.y.z which is reserved as a single block, and has netmask 255.0.0.0 unless you divide it futher (usually you do). This is big enough space to fit private corporate networks at least most of the time, with potentially huge number of smaller sub-networks of it's own.
Then there's 192.168.x.y, which is a set of 256 networks, each with netmask 255.255.255.0, and each of which has room for 256 IP addresses (or well, 254 as you might not want to use 0 and 255, which have special meanings). You could also use 192.168.x.y as a single 255.255.0.0 network, but usually that's not how it's used.
Then there's a third one, which nobody care about, starting 172...blah. It's nasty area and we don't like it so we'll ignore it. It has a netmask of 255.240.0.0 which is pretty ugly. Not so ugly if you write it as 172.16.0.0/12. We could write 192.168.0.0/16 for the whole 192.168.x.y block, though normally you have 192.168.x.0/24. Hehe, so we indeed often write /x instead of ugly netmask, and that's how many bits in the written-out-mask are ones.
There's some other special networks, 127.0.0.0/8 is looback. It always means the same computer. Most often you see 127.0.0.1 but 127.1.2.3 would be equally valid and it'd still be loopback. Another block you commonly see is 169.254.0.0/16 which is for "auto-DHCP" or dynamic IP addresses without having a DHCP server, as in if you plug a group of laptops into a switch, they'll figure out 169.254.x.y addresses for themselves so you can play Quake without having any network configuration. Not good for much else.
Then there's broadcasts (255 meaning all, say: 255.255.255.255 for everyone in the internet, 192.168.1.255 would be everyone in my home LAN) and this net (192.168.1.0 would be address of that same LAN). Lots of other nasty stuff too, but mostly safe to ignore.
So what do you do with these pieces of info? Say, you picked 192.168.1.0/24 as your local network between your normal computer and your OS. Say, your normal computer is going to be 192.168.1.11 and your OS is going to be 192.168.1.12. And then you have an old Linux box as gateway (at 192.168.1.1) which knows how to do NAT (transparently replace your local 192.168.x.y addresses to public IPs and back).
So if we convert the /24 into bits, we get FF:FF:FF:00 in hex, or 255.255.255.0 in decimal. Now when you wanna send something, you take your own IP address and the netmask, and Bitwise-AND them. For 192.168.1.12 and 255.255.255.0 this gives you 192.168.1.0 (which is "this network" quite surprisingly). Then you take the destination address (say 192.168.1.11) and do the same, giving you either 192.168.1.0 again (if it's in the same network) or something completely different.
If you get the same network address for yourself and the destination, you know it's in the same network, consult ethernet layer for an ethernet address of the destination (which potentially sends some ARP packets) and then you fire the packet directly to where it's going. If it's not in the same network, you need to send it through the gateway. So the IP packet still looks exactly the same, but you instead ask the ethernet layer for the ethernet address of the gateway, and then use that when you put it on wire (IP headers still contain the address of the final destination so the gateway can figure out where to send it next).
So, basicly, you pick up a private network, like 192.168.x.0/24 (with x between 1-254, or 0 for Windows TAP with NAT for QEMU), then allocate different addresses from this to each of the hosts in the network. It's common to have a single gateway get the address x.y.z.1, though my personal home LAN forexample doesn't follow this convention (for historic reasons my gateway is .2).
Then every time you're sending a packet, you ask your ethernet ARP subsystem for either the hosts or the gateways ethernet address, depending on whether it's network address is same or different as yours, which you find out by doing bitwise-and with the network mask for each address and comparing the results. This is called "first-hop" routing btw, and is basicly the over-simplification of what a gateway does when it consults routing tables to figure out what direction it should be sending a given packet. But a simple host can just do first-hop routing and ignore the complexity.
That's about it... if you have more than one computer, I'd start by playing a network admin a bit first.