Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
By the way, yes, both machines have different IP addresses, but the same subnet mask. They are logically on 2 different subnets, while on one physical subnet. The network id of your linux machine is 208.152.6.0, while the Win machine network id is 208.152.2.0. For further explaination, check out this website:
I know you want to do this automatically, but here is what I would do, and you would only have to do this once:
On XP:
Go to your network properties, TCP/IP properties, Alternate Configuration tab, and manually assign an IP address and netmask (ex. 192.168.0.1 mask:255.255.255.0)
-On Linux: Create a subinterface eth0:1 and assign an IP from the same subnet in previous example (ex. 192.168.0.2 mask:255.255.255.0)
-Modify your hosts file to reflect the name/ip mappings on BOTH machines (linux, typically /etc/hosts-- on Windows XP: c:\<system root>\system32\drivers\etc\hosts
This is also a better idea for security, I would bind samba only to your internal IP on linux.
Hope this helps!
Slow down please, you're heading too fast. I understand how to add an alterate Ip config in Winbloze XP. However, exatly WHAT do i insert into the hosts file of each OS?
Also, I simply do not know how to create a sub interface in linux. can you shed some light into how this can be done? Thanx.
I might check the links you gave on IP when I have some more time. please see if u can kindly explain what sub interfaces are and how they can be added.
Just to try to help you understand the whole subnet deal:
basics: 1. 255 is the same as 11111111 in binary (all 1's)
2. IP adress are 32 bits (32 1's and 0's) and each "." in the IP seperates 8 bits so an IP of 1.1.1.1 is the same as 00000001.00000001.00000001.00000001 and a mask of 255.255.255.255 is the same as 11111111.11111111.11111111.11111111
when an IP is given, you never really know what subnetwork you are on unless you are given the subnet mask, in your case the masks are 255.255.255.0 which is the same as saying "all IP addresses that have the 1st 24 bits in common are on the same subnetwork" . In your case you have 208.152.2.199 and 208.152.6.114 both having subnet masks of 255.255.255.0 which means they have to match on the 1st 3 sections to be on the same network, which they dont because one is on a .6 subnet and the other is on a .2 subnet. So in order for those two computer to communicate, they have to pass through a router which holds the information about the different subnets and where to forward traffic. Nevermind the fact that these two computers are both plugged into the same hub, that wont matter because of the stuff discussed above. I realize its hard to give and understand a lesson on subnetting in a forum and im not the best teacher in the world so if none of that stuff made any sense, just know that communication will not work directly with those 2 cmoputers if the 1st 24 bits of the IPs arent the same. If your netmasks were 255.255.0.0 then u'd be cool, but they arent.
Ah, that does make sense. After all I'm a computer science student
Thanx for the clarification.
I still wonder though how come Winbloze manages to netwrok the two machines even though they have different ip trees (as in one is a 208.152.2.x and the othert is a 208.152.6.x) ???
Also, is ther any way to FORCE the dhcp server to assign me a 208.152.2.x ip?
Thanx
I really appreciate you taking time to explain things, btw
This one is not specific to tcp/ip but it will give you some understanding on the standards of networking, if you want more information just do a search for OSI Layer Model, or the TCP/IP OSI Layer Model.
I still wonder though how come Winbloze manages to netwrok the two machines even though they have different ip trees (as in one is a 208.152.2.x and the othert is a 208.152.6.x) ???
Also, is ther any way to FORCE the dhcp server to assign me a 208.152.2.x ip?
I'm not entirely sure about the in's and out's of Samba- but with Windows machines netbios enabled over TCP/IP any shared files on an unprotected machine can be accessed from any other windows machine - all you need is the IP address and it'll get routed to it. It's quite a common mistake people using windows make. I'm not sure if there are any differences in the way Samba deals with stuff at that level.
You can't force the DHCP server to give you specific addresses unless you arrange for static IP's from your ISP.
Last edited by Looking_Lost; 04-24-2003 at 02:26 PM.
It is extremly diffucult to get networking to work if you are using a hub connected to your ISP. Each time you connect your system can get a new IP, thus negating any static information you may have entered.
The best way to accomplish this is to purchase a 49$ (US) DSL router which will then assign an address to any DHCP configured system that you attach to it (normally 192.168.0.*). You can also configure internet connection sharing in Windows then let your Linux system get its IP from Windows (need 2nd NIC in Windows).
Remember your ISP is giving you an IP via DHCP which can change without notice so even if you get things to work now, it could break in an hour.
You should also be carefull about giving your system a static IP on the same subnet as your ISP. This could break sombody elses connection. Interesting note: Some local ISP's actually give you a subnet mask of 255.255.255.252.
Originally posted by shassouneh Ah, that does make sense. After all I'm a computer science student
Thanx for the clarification.
I still wonder though how come Winbloze manages to netwrok the two machines even though they have different ip trees (as in one is a 208.152.2.x and the othert is a 208.152.6.x) ???
Also, is ther any way to FORCE the dhcp server to assign me a 208.152.2.x ip?
Thanx
I really appreciate you taking time to explain things, btw
Its possible that you have a diffeerent protocol enabled...?
IPX/SPX (Novell) or NetBeui (MS)? Several versions of Windoze come with thos enabled by default.
As for the protocols only TCP/Ip is used opn our LAN for networking. The other machine is a Microsoft Windows XP machine, which by default doesn't have NetBEUI (although there are ways to install it easily).
I think cdhjrt mad a good point. We are considering buying a wireless routing solution
Thanx for all the feedback everyone. I really appreciate it
Originally posted by shassouneh Slow down please, you're heading too fast. I understand how to add an alterate Ip config in Winbloze XP. However, exatly WHAT do i insert into the hosts file of each OS?
Also, I simply do not know how to create a sub interface in linux. can you shed some light into how this can be done? Thanx.
I might check the links you gave on IP when I have some more time. please see if u can kindly explain what sub interfaces are and how they can be added.
to add a subinterface in linux:
ifconfig eth0:1 <ip address> <netmask> <bcast> up
example: ifconfig eth0:1 192.168.0.2 mask 255.255.255.0 bcast 192.168.0.255 up
In the hosts file of XP and linux (file paths pointed out in previous post), add entries like this:
example: Assuming the xp machine is named XPHOME with alternate IP address of 192.168.0.1, and your linux machine's SAMBA name as LINUXBOX, and the eth0:1 IP address is 192.168.0.2, here is what your hosts file entries will be:
192.168.0.1 xphome
192.168.0.2 linuxbox
You can also add more aliases to the ip mappings, suppose your linux machine had a hostname of linuxbox and a fully qualified hostname as linuxbox.domain.com, and a SAMBA name as LINUXSRV, the entries would be modified as follows:
Thanx for the clarification.It makes a bit more sense now
I can say this networking thing has me in a dizzy confused loop. LOL. Networking is no longer my cup of tea, lol.
Thanx for all the help guys. MUCH MUCH appreciated indeed
One Computer with 2 nic's will connect to the internet
Second computer will connect to the first computer via crossover cable
Second computer will access the internet provided by the First computer
still new to the nitty gritty of Linux - I think you setup IpTable rules and run DHCP if that's the one connected to the internet - if the windows one I'm pretty sure you can use ICS and Linux will get the settings from that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.