Networking – device versus network interface ip addresses – unix & linux stack exchange
Each network interface may have it’s own Ip if IP visitors are to circulate through it.
For example take, your router/modem device that many homes and/or small offices have.
There’ll an association for your computers/laptops around the internal side from the router – whether that’s Wireless or Ethernet. They are normally within the private address ranges of 191.168.. – 192.168.255.254 or sometimes 10… – 10.255.255.254. Your desktop/laptop/tablet will connect with this side from the tool and have itself and Ip within the same range (although not like the device).
Around the exterior side from the router/modem you’ll have a completely separate Ip usually allotted for your device instantly through the company. This can be a routable address for example 98.23.45.62 that is globally unique for your modem/router even though it is connected.
Small modem/routers like these could be confusing because they will appear to possess only the one address – the main one quoted within the instructions for administrating the unit using a internet browser (for example http://192.168..1) – although it has numerous Ethernet ports. It is because the unit, essentially includes a network switch tagged to the router to be able to split the router’s single Ethernet port into many ports and to be able to connect a Wireless bridge.
Simultaneously, the exterior side from the router/modem may have it’s Ip instantly configured through the company to well never view it. (Type what’s my Ip in the search engines to discover what it’s).
A diagram might help:
+——–+
laptop
+——–+
+—–+ +————-+ +——–+ 10…2
98.23.45.61 10…1 ——-+
ISP —————-+ modem/router————– switch
98.23.45.62 ——-+
+—–+ +————-+ +——–+ 10…3
+———+
desktop
+———+
As you can tell, the modem/router has two IP addresses Body for every network interface. The desktop and laptops get one – around the networking device linked to your router. Most modem/routers have Wireless and Ethernet connections just like most laptops. Should you connect the Ethernet cable for your laptop as well as enable and configure your laptop’s Wireless then this too might have two IP addresses Body for every device – in the ten…by address range. That will give you problems thought – do not do it.
A port is simply a number that’s connected to the destination Ip. It’s just like a mobile phone extension within an office switchboard and decides which services are to get your traffic. It’s a 16-bit number, which provides it an optimum possible 65535. Merely a really small subset of those are utilized though. Many are pre-allotted as well-known ports for example http traffic on port 80 and secure covering (ssh) on port 22. These ports are just open and listening for traffic when the relevant services are running around the device as installed through the device manufacturer.
Within the situation from the modem router above, port 80 is going to be listening around the internal side just because a webserver is running to be able to administer the unit utilizing a internet browser. Some routers in addition have a ssh service listening on port 22 to be able to manage the unit utilizing a ssh client. They’ll most likely have port 53 open as you will see a DNS server running around the router too.
Your laptop will most likely (hopefully) don’t have any ports listening, unless of course you’ve installed something with that device. Within the diagram above, you can use a ssh server server around the desktop computer after which (and firewalls permitting) your desktop may have port 22 open. Your laptop may then ssh to port 22 from the desktop and login.
Therefore, the amount of ports on the system is lower to the number of services are running with that device, the configuration of this service, and also the configuration from the firewall.
If you wish to result in the ssh server running on your hard drive within the example above, accessible from the remote user somewhere on the web you’d hit a little problem as, although there are many internal addresses, you simply get one exterior (98.23.45.62).
Each network interface may have it’s own Ip if IP visitors are to circulate through it.
For example take, your router/modem device that many homes and/or small offices have.
There’ll an association for your computers/laptops around the internal side from the router – whether that’s Wireless or Ethernet. They are normally within the private address ranges of 191.168.. – 192.168.255.254 or sometimes 10… – 10.255.255.254. Your desktop/laptop/tablet will connect with this side from the tool and have itself and Ip within the same range (although not like the device).
Around the exterior side from the router/modem you’ll have a completely separate Ip usually allotted for your device instantly through the company. This can be a routable address for example 98.23.45.62 that is globally unique for your modem/router even though it is connected.
Small modem/routers like these could be confusing because they will appear to possess only the one address – the main one quoted within the instructions for administrating the unit using a internet browser (for example http://192.168..1) – although it has numerous Ethernet ports. It is because the unit, essentially includes a network switch tagged to the router to be able to split the router’s single Ethernet port into many ports and to be able to connect a Wireless bridge.
Simultaneously, the exterior side from the router/modem may have it’s Ip instantly configured through the company to well never view it. (Type what’s my Ip in the search engines to discover what it’s).
A diagram might help:
+——–+
laptop
+——–+
+—–+ +————-+ +——–+ 10…2
98.23.45.61 10…1 ——-+
ISP —————-+ modem/router————– switch
98.23.45.62 ——-+
+—–+ +————-+ +——–+ 10…3
+———+
desktop
+———+
As you can tell, the modem/router has two IP addresses Body for every network interface. The desktop and laptops get one – around the networking device linked to your router. Most modem/routers have Wireless and Ethernet connections just like most laptops. Should you connect the Ethernet cable for your laptop as well as enable and configure your laptop’s Wireless then this too might have two IP addresses Body for every device – in the ten…by address range. That will give you problems thought – do not do it.
A port is simply a number that’s connected to the destination Ip. It’s just like a mobile phone extension within an office switchboard and decides which services are to get your traffic. It’s a 16-bit number, which provides it an optimum possible 65535. Merely a really small subset of those are utilized though. Many are pre-allotted as well-known ports for example http traffic on port 80 and secure covering (ssh) on port 22. These ports are just open and listening for traffic when the relevant services are running around the device as installed through the device manufacturer.
Within the situation from the modem router above, port 80 is going to be listening around the internal side just because a webserver is running to be able to administer the unit utilizing a internet browser. Some routers in addition have a ssh service listening on port 22 to be able to manage the unit utilizing a ssh client. They’ll most likely have port 53 open as you will see a DNS server running around the router too.
Your laptop will most likely (hopefully) don’t have any ports listening, unless of course you’ve installed something with that device. Within the diagram above, you can use a ssh server server around the desktop computer after which (and firewalls permitting) your desktop may have port 22 open. Your laptop may then ssh to port 22 from the desktop and login.
Therefore, the amount of ports on the system is lower to the number of services are running with that device, the configuration of this service, and also the configuration from the firewall.
If you wish to result in the ssh server running on your hard drive within the example above, accessible from the remote user somewhere on the web you’d hit a little problem as, although there are many internal addresses, you simply get one exterior (98.23.45.62).
To solve this you would need to configure a center referred to as Port Forwarding in your router. This instructs the router to consider all traffic coming in a particular port and forward it to some specific internal host and port.
Within this situation, all traffic coming at port 22 is given to 10…2 port 22. Since you may have collected, which means that you are able to have only port 22 given to one internal server.
Should you wanted so that you can ssh to both desktop and also the laptop, you’d need to configure the router to pay attention with an alternate exterior port (for example 2022) and forward that for your laptop at 10…2 port 22. The remote user would need to ssh 98.23.45.62 to gain access to the desktop and ssh -p 2022 98.23.45.62 to gain access to your laptop.
Obviously, it isn’t always as easy as this because the exterior Ip can alter unless of course you particularly request/buy a static Ip.
Resourse: https://unix.stackexchange.com/questions/232944/