<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>network &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/network-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.veriteknik.net.tr/en/</link>
	<description>VeriTeknik Bilişim &#124; VeriTeknik Bilişim</description>
	<lastBuildDate>Wed, 11 Dec 2013 10:46:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Add Multiple Gateways to Multiple NICs on Ubuntu Server</title>
		<link>https://www.veriteknik.net.tr/en/add-multiple-gateways-multiple-nics-ubuntu-server/</link>
					<comments>https://www.veriteknik.net.tr/en/add-multiple-gateways-multiple-nics-ubuntu-server/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Wed, 11 Dec 2013 10:46:32 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=924</guid>

					<description><![CDATA[<p>Even though this seems an easy task, when you add IP&#8217;s with different gateways, you have to route the IP&#8217;s for the correct gateways. Let&#8217;s say you have two networks, 192.168.80.128/25 192.168.90.128/25 This means your gateways are 192.168.80.129, 192.168.90.129 and you have these IP addresses respectively : 192.168.80.130-254, 192.168.90.130-254 Lets assign the 192.168.80.x IP&#8217;s to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/add-multiple-gateways-multiple-nics-ubuntu-server/">Add Multiple Gateways to Multiple NICs on Ubuntu Server</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Even though this seems an easy task, when you add IP&#8217;s with different gateways, you have to route the IP&#8217;s for the correct gateways.</p>
<p>Let&#8217;s say you have two networks,<br />
192.168.80.128/25<br />
192.168.90.128/25</p>
<p>This means your gateways are 192.168.80.129, 192.168.90.129 and you have these IP addresses respectively : 192.168.80.130-254, 192.168.90.130-254</p>
<p>Lets assign the 192.168.80.x IP&#8217;s to eth0 and 90.x to eth1.<br />
Then we&#8217;ll have to edit our <strong>/etc/network/interfaces</strong> file accordingly:</p>
<pre class="brush: text; gutter: true; first-line: 1">auto lo
iface lo inet loopback

auto eth0 eth0:1 eth1 eth1:1

iface eth0 inet static
    address 192.168.80.130
    netmask 255.255.255.128
    gateway 192.168.80.129

iface eth0:1 inet static
    address 192.168.80.131
    netmask 255.255.255.128

iface eth1 inet static
    address 192.168.90.130
    netmask 255.255.255.128

iface eth1:1 inet static
    address 192.168.90.131
    netmask 255.255.255.128

post-up ip route add default via 192.168.90.129 dev eth1 table 101</pre>
<p>As you can see, we did not specify any gateways for other devices than eth0. This is because, we will route the 192.168.90.x IP addresses through 192.168.90.129 but the system will not know it as a default gateway. That&#8217;s why we added the last line to interfaces, we tell to route 192.168.90.129 using table 101. Well, you&#8217;ll say <em>&#8220;We haven&#8217;t defined that table yet, what&#8217;s this 101?&#8221;</em>, that&#8217;s true, normally you have to define it in your shell, but we&#8217;ll add it to our rc.local so that it will be there all the time (after a reboot).</p>
<p>In order to achieve this, we add the following line to <strong>/etc/rc.local</strong> (add it before the &#8220;exit 0&#8221;)</p>
<pre class="brush: text; gutter: true; first-line: 1">ip rule add from 192.168.90.128/25 lookup 101</pre>
<p>Now write the ip rule to your shell too (so you won&#8217;t need a reboot) then restart your networking service.</p>
<pre class="brush: bash; gutter: true; first-line: 1">/etc/init.d/networking stop &amp;&amp; /etc/init.d/networking start</pre>
<p>Here you go, <strong>route -n</strong> will show you only one gateway, yet you&#8217;ll be able to use both IP classes on both devices. So technically we did not add two gateways, but we&#8217;re using both of them.</p>
<p>Don&#8217;t forget that we only added 4 IP&#8217;s here, if you want to add all of them in the block, you better write a script to generate it.</p>
<p>Ok you don&#8217;t have to cry about it, below is a Python script I wrote for you, edit it accordingly 🙂</p>
<pre class="brush: python; gutter: true; first-line: 1">#/usr/bin/python

#ip generator script - plugged.in

IP_c1 = 80
IP_c2 = 90

print "auto lo"
print "iface lo inet loopback"

print "auto eth0"
print "iface eth0 inet static"
print "\taddress 192.168.%i.130" % IP_c1
print "\tnetmask 255.255.255.128"
print "\tgateway 192.168.%i.129" % IP_c1

print "auto %s %s" % (" ".join(["eth0:%i" % i for i in range(1,124)])," ".join(["eth1:%i" % i for i in range(1,128)]))

for c in [IP_c1,IP_c2] :
    if c == IP_c1 :
        for i in range(131,255) :
            print "iface eth0:%i inet static" % (i-130)
            print "\taddress 192.168.%i.%i" % (c,i)
            print "\tnetmask 255.255.255.128"
    else :
        for i in range(130,255) :
            print "iface eth1:%i inet static" % (i-129)
            print "\taddress 192.168.%i.%i" % (c,i)
            print "\tnetmask 255.255.255.128"

print "post-up ip route add default via 192.168.90.129 dev eth1 table 101"</pre>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/add-multiple-gateways-multiple-nics-ubuntu-server/">Add Multiple Gateways to Multiple NICs on Ubuntu Server</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/add-multiple-gateways-multiple-nics-ubuntu-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">924</post-id>	</item>
		<item>
		<title>Routing, a Brief Introduction</title>
		<link>https://www.veriteknik.net.tr/en/routing-a-brief-introduction/</link>
					<comments>https://www.veriteknik.net.tr/en/routing-a-brief-introduction/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Tue, 22 May 2012 12:37:22 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[ARP]]></category>
		<category><![CDATA[BGP]]></category>
		<category><![CDATA[CIDR]]></category>
		<category><![CDATA[hop]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[OSPF]]></category>
		<category><![CDATA[RIP]]></category>
		<category><![CDATA[route]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[switch]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=427</guid>

					<description><![CDATA[<p>Introduction Routing is the process of finding the route to a destination, and routing protocols determine how a router updates its route information. A router is attached to two or more networks, and its primary function is receiving IP packets through one network interface and forwarding them through another. The packets can travel through a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/routing-a-brief-introduction/">Routing, a Brief Introduction</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3></h3>
<p>Introduction</p>
<p style="text-align: justify;">Routing is the process of finding the route to a destination, and routing protocols determine how a router updates its route information. A router is attached to two or more networks, and its primary function is receiving IP packets through one network interface and forwarding them through another. The packets can travel through a number of routers before arriving at their final destination. Each router-to-router transmission is called a hop.</p>
<p style="text-align: justify;">Routing is moving information across an internetwork from source to destination. Along the way, at least one intermediate node is typically encountered. Routing is often contrasted with bridging which seems to accomplish precisely the same thing. The primary difference between the two is that bridging occurs at Layer 2 (the link layer) of the OSI reference model, while routing occurs at Layer 3 (the network layer). This distinction provides routing and bridging with different information to use in the process of moving information from source to destination. As a result, routing and bridging accomplish their tasks in different ways and, in fact, there are several different kinds of routing and bridging.</p>
<h4 style="text-align: justify;">In the Internet context there are three major aspects of routing</h4>
<ol>
<li>Physical Address Determination</li>
<li>Selection of inter-network gateways</li>
<li>Symbolic and Numeric Addresses</li>
</ol>
<p style="text-align: justify;">The first of these is necessary when an IP datagram is to be transmitted from a computer. It is necessary to encapsulate the IP datagram within whatever frame format is in use on the local network or networks to which the computer is attached. This encapsulation clearly requires the inclusion of a local network address or physical address within the frame.</p>
<p>The second of these is necessary because the Internet consists of a number of local networks interconnected by one or more gateways. Such gateways, generally known as routers, sometimes have physical connections or ports onto many networks. The determination of the appropriate gateway and port for a particular IP datagram is called routing and also involves gateways interchanging information in standard ways.</p>
<p>The third aspect which involves address translation from a reasonably human friendly form to numeric IP addresses is performed by a system known as the Domain Name System or DNS for short. It is not considered further at this stage.</p>
<p style="text-align: justify;"> The topic of routing has been covered in computer science literature for over two decades, but routing only achieved commercial popularity in the mid-1980s. The primary reason for this time lag is the nature of networks in the 1970s. During this time, networks were fairly simple, homogeneous environments. Only recently has large-scale internetworking become popular.</p>
<h4>Routing Components</h4>
<p>Routing involves two basic activities: determination of optimal routing paths and the transport of information groups (typically called packets) through an internetwork. Path determination, on the other hand, can be very complex.</p>
<h3>Path Determination</h3>
<p style="text-align: justify;">A metric is a standard of measurement&#8212;for example, path length&#8212;that is used by routing algorithms to determine the optimal path to a destination. To aid the process of path determination, routing algorithms initialize and maintain routing tables, which contain route information. Route information varies depending on the routing algorithm used.</p>
<p>Routing algorithms fill routing tables with a variety of information. Destination/next hop associations tell a router that a particular destination can be gained optimally by sending the packet to a particular router representing the &#8220;next hop&#8221; on the way to the final destination. When a router receives an incoming packet, it checks the destination address and attempts to associate this address with a next hop.</p>
<p style="text-align: justify;">Routing tables can also contain other information, such as information about the desirability of a path. Routers compare metrics to determine optimal routes. Metrics differ depending on the design of the routing algorithm being used.</p>
<p>Routers communicate with one another (and maintain their routing tables) through the transmission of a variety of messages. The routing update message is one such message. Routing updates generally consist of all or a portion of a routing table. By analyzing routing updates from all routers, a router can build a detailed picture of network topology. A link-state advertisement is another example of a message sent between routers. Link-state advertisements inform other routers of the state of the sender&#8217;s links. Link information can also be used to build a complete picture of network topology. Once the network topology is understood, routers can determine optimal routes to network destinations.</p>
<p style="text-align: justify;">If a computer wishes to transmit an IP datagram it needs to encapsulate in a frame appropriate to the physical medium of the network it is attached to. For the successful transmission of such a frame it is necessary to determine the physical address of the destination computer. This can be achieved fairly simply using a table that will map IP addresses to physical addresses, such a table may include addresses for IP nets and a default address as well as the physical addresses corresponding to the IP addresses of locally connected computers.</p>
<p>Such a table could be configured into a file and read into memory at boot up time. However it is normal practice for a computer to use a protocol known as ARP (Address Resolution Protocol) and defined by RFC 826. This operates dynamically to maintain the translation table known as the ARP cache. A computer determines its own physical address at boot up by examining the hardware and its own IP address by reading a configuration file at boot up time but it is necessary to fill the ARP cache. This is done by the computer making ARP request broadcasts whenever it encounters an IP address that cannot be mapped to a physical address by consulting the cache.</p>
<p>The format of an ARP request on an Ethernet is;</p>
<table class="aligncenter" style="border: 1px solid #594fb0;" border="1" align="center">
<tbody>
<tr>
<td><strong>General</strong></td>
<td><strong>Use</strong></td>
<td><strong>Size in Bytes</strong></td>
<td><strong>Typical Values</strong></td>
</tr>
<tr>
<td rowspan="3"><strong>Ethernet Header</strong></td>
<td>Ethernet Destination Address</td>
<td>6</td>
<td>A broadcast address</td>
</tr>
<tr>
<td>Ethernet Source Address</td>
<td>6</td>
<td>Identifies the computer making the request</td>
</tr>
<tr>
<td>Frame Type</td>
<td>2</td>
<td>Set to 0x0806 for ARP request and 0x8035 for an ARP reply</td>
</tr>
<tr>
<td rowspan="9"><strong>ARP request/reply </strong></td>
<td>Hardware Type</td>
<td> 2</td>
<td> Set to 1 for an Ethernet</td>
</tr>
<tr>
<td>Protocol Type</td>
<td> 2</td>
<td>Set to 0x0800 for IP Addresses</td>
</tr>
<tr>
<td>Hardware Address Size in bytes</td>
<td> 1</td>
<td>Set to 6 for Ethernet</td>
</tr>
<tr>
<td>Protocol Address Size in bytes</td>
<td> 1</td>
<td>Set to 4 for IP</td>
</tr>
<tr>
<td>Operation</td>
<td> 2</td>
<td>1 for request, 2 for reply</td>
</tr>
<tr>
<td>Sender Ethernet Address</td>
<td> 6</td>
<td>&#8211;</td>
</tr>
<tr>
<td>Sender IP Address</td>
<td> 4</td>
<td>&#8211;</td>
</tr>
<tr>
<td>Destination Ethernet Address</td>
<td> 6</td>
<td>Not filled in on ARP Request</td>
</tr>
<tr>
<td>Destination IP Address</td>
<td> 4</td>
<td>&#8211;</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"><strong>ARP request table format on Ethernet</strong></p>
<p style="text-align: justify;">By making such requests a host can fill up the ARP cache. ARP cache entries will eventually time-out and a new query will have to be made. This allows a computer to respond to changing topology. Typical timeouts are about 20 minutes. An ARP request to a non-existent computer may be repeated after a few seconds up to a modest maximum number of times.</p>
<p>If a computer is connected to more than one network via separate ports then a separate ARP cache will be maintained for each interface. Alternatively there will be a further entry in the ARP cache associating an entry with a particular interface.<br />
It may be thought that ARP requests will be made for every Internet computer a computer wishes to contact. This is not true, a reference to an IP address not on a local or directly connected network will be re-directed to an IP router computer with an IP address that is on a local directly connected network.</p>
<p>Since ARP requests are broadcast any computer maintaining an ARP cache can monitor all such broadcasts and extract the sending computer&#8217;s physical and IP address and update its own ARP cache as necessary. When a computer boots up it can send an ARP request as a means of announcing its presence on the local network. It is possible to associate more than one IP address with a single physical address.</p>
<h2 style="text-align: justify;">Switching</h2>
<p style="text-align: justify;">Switching algorithms are relatively simple and are basically the same for most routing protocols. In most cases, a host determines that it must send a packet to another host. Having acquired a router&#8217;s address by some means, the source host sends a packet addressed specifically to a router&#8217;s physical (Media Access Control [MAC]-layer) address, but with the protocol (network-layer) address of the destination host.</p>
<p style="text-align: justify;">On examining the packet&#8217;s destination protocol address, the router determines that it either knows or does not know how to forward the packet to the next hop. If the router does not know how to forward the packet, it typically drops the packet. If the router knows how to forward the packet, it changes the destination physical address to that of the next hop and transmits the packet.</p>
<p style="text-align: justify;">The next hop may or may not be the ultimate destination host. If not, the next hop is usually another router, which executes the same switching decision process. As the packet moves through the internetwork, its physical address changes but its protocol address remains constant.</p>
<p style="text-align: justify;">The International Organization for Standardization (ISO) has developed a hierarchical terminology that is useful in describing this process. Using this terminology, network devices without the ability to forward packets between subnetworks are called <em>end systems</em> (ESs), while network devices with these capabilities are referred to as <em>intermediate systems</em> (ISs). ISs are further divided into those that can communicate within routing domains (intradomain ISs) and those that communicate both within and between routing domains (interdomain ISs). A routing domain is generally considered to be a portion of an internetwork under common administrative authority, regulated by a particular set of administrative guidelines. Routing domains are also called <em>autonomous systems</em>. With certain protocols, routing domains can also be divided into routing areas, but intradomain routing protocols are still used for switching both within and between areas.</p>
<h2 style="text-align: justify;">Routing Protocols</h2>
<h4>Border Gateway Protocol</h4>
<p style="text-align: justify;">One protocol that addresses the task of path determination in today&#8217;s networks is the Border Gateway Protocol (BGP). BGP performs interdomain routing in Transmission-Control Protocol/Internet Protocol (TCP/IP) networks. BGP is an exterior gateway protocol (EGP), which means that it performs routing between multiple autonomous systems or domains and exchanges routing and reachability information with other BGP systems.</p>
<p><strong>BGP is specified in several Request For Comments (RFCs):</strong></p>
<ul>
<li>RFC 1771 &#8212;Describes BGP4, the current version of BGP</li>
<li>RFC 1654&#8212;Describes the first BGP4 specification</li>
<li>RFC 1105, RFC 1163, and RFC 1267&#8212;Describes versions of BGP prior to BGP4</li>
</ul>
<h4>BGP Operation</h4>
<p style="text-align: justify;">BGP performs three types of routing: interautonomous system routing, intra-autonomous system routing, and pass-through autonomous system routing.</p>
<p><strong>Interautonomous system routing</strong> occurs between two or more BGP routers in different autonomous systems. Peer routers in these systems use BGP to maintain a consistent view of the internetwork topology. BGP neighbors communicating between autonomous systems must reside on the same physical network. The Internet serves as an example of an entity that uses this type of routing because it is comprised of autonomous systems or administrative domains. Many of these domains represent the various institutions, corporations, and entities that make up the Internet. BGP is frequently used to provide path determination to provide optimal routing within the Internet.</p>
<p style="text-align: justify;"><strong>Intra-autonomous system routing</strong> occurs between two or more BGP routers located within the same autonomous system. Peer routers within the same autonomous system use BGP to maintain a consistent view of the system topology. BGP also is used to determine which router will serve as the connection point for specific external autonomous systems. Once again, the Internet provides an example of interautonomous system routing. An organization, such as a university, could make use of BGP to provide optimal routing within its own administrative domain or autonomous system. The BGP protocol can provide both inter- and intra-autonomous system routing services.</p>
<p><strong>Pass-through autonomous system routing</strong> occurs between two or more BGP peer routers that exchange traffic across an autonomous system that does not run BGP. In a pass-through autonomous system environment, the BGP traffic did not originate within the autonomous system in question and is not destined for a node in the autonomous system. BGP must interact with whatever intra-autonomous system routing protocol is being used to successfully transport BGP traffic through that autonomous system.</p>
<h3>OSPF</h3>
<p style="text-align: justify;">The<strong> Open Shortest Path First</strong> (OSPF) routing protocol is designed for a hierarchical network structure. The community of routers, usually owned and managed by a single group is called an autonomous system (AS). OSPF divides the world into two domains—within the autonomous system and external to the autonomous system. The autonomous system itself is divided into a central, or backbone area<br />
(area 0) to which all other areas are connected, and other (nonzero) numbered areas.</p>
<h4>Areas</h4>
<p>Each OSPF area has one or more network address/netmask pairs and is identified by a 32-bit area number. An area is a contiguous set of routers sharing network segments between them. An area must be one of the following types, depending upon the routing information that it uses:</p>
<ul>
<li><strong>Transit area</strong> &#8211; An area where routing information for a default route, static routes, intra-area routes, interarea routes, and autonomous system external routes is kept in the area database. The backbone area falls into this category.</li>
<li><strong>Stub area</strong> &#8211; An area where all autonomous system external routes are summarized by a per-area default route in the area database, which also contains intra-area and interarea routes. Summarization reduces the database size and memory requirements for a stub area’s internal routers. A stub area frequently has only one area border router (ABR).</li>
<li><strong>Not-so-stubby area</strong> (NSSA) &#8211; Similar to a stub area, but it can export limited autonomous system external route information to the backbone. The NSSA is useful for areas that do not need to retain all the autonomous system external route information flooded into the area, but do need to export some limited external route information not permitted from standard OSPF stub areas.</li>
</ul>
<h3>RIP</h3>
<p>The Routing Information Protocol (RIP) is an interior routing protocol that uses a distance-vector algorithm to optimize routing. It is widely used by routers in TCP/IP networks and Novell IPX networks.</p>
<p>The distance-vector algorithm used by RIP for making routing decisions is based on the number of hops to a destination. The route with the least number of hops is considered to have the lowest cost. The number of hops is referred to as the route metric; a route with a metric greater than 15 is considered to be unreachable.</p>
<p>Routing table entries for RIP are aged as follows:</p>
<ul>
<li>Updates are expected every 30 seconds.</li>
<li>After 120 seconds, if information for another route to a given destination is observed the new route is used for the destination.</li>
<li>After 180 seconds without an update, a route is considered unreachable. RIP makes the route obsolete by setting the route metric to 16.</li>
<li>The routing timer is suspended if an on-demand interface is suspended.</li>
<li>Routes are valid only for active interfaces.</li>
<li>If an interface becomes unreachable, all routes that go through that interface are examined. If the specified gateway is available through another interface, the route is moved to the active interface. Otherwise, the routing table entry is marked as obsolete.</li>
</ul>
<h2>Types of Routing</h2>
<h4>Static Routing</h4>
<p style="text-align: justify;">Static routes contain route information that does not respond to changes in network topology or condition. In spite of this inability to respond to change, static routes can be useful for stable networks or segments of networks that are not expected to change frequently.</p>
<p>Other possible uses for static routing are</p>
<ul>
<li>For operations that use or connect to routers that do not support the routing protocols supported by the Lucent ComOS</li>
<li>For operations over WAN links where costs are determined by connect time or number of packets sent, and the use of routing protocols adds to the cost Static routing tables are constructed manually by the network administrator, who must update them periodically to reflect any network changes.</li>
</ul>
<h4>Dynamic Routing</h4>
<p style="text-align: justify;">If a network has more than one possible route to a destination, or if the network is large or complex, or experiences frequent changes, dynamic or learned routing through the use of routing protocols is necessary. Routing protocols collect routing information, broadcast it dynamically, and update routing tables automatically to reflect network changes.</p>
<p>Dynamic routing adds a high degree of flexibility to the routing process by</p>
<ul>
<li>Permitting the selection of routes based on cost or congestion criteria</li>
<li>Allowing redundant routes to compensate for downed lines</li>
<li>Selecting the best route to a destination when multiple routes exist</li>
<li>Providing fast response to network changes</li>
</ul>
<h4>Variable-Length Subnet Masks</h4>
<p style="text-align: justify;">The commonly used Routing Information Protocol (RIP) requires that a single netmask be used across the entire subnet. This limitation has a major impact on the routing of traffic among many networks. Regardless of the actual need for addresses, each subnet of the network must be assigned the same number of IP addresses. The use of more than one subnet mask in a subnetted network is described in RFC 1812. A network using this method of subnetting is referred to as a network with variable-length subnet masks (VLSMs) because the network prefixes have different lengths. VLSM support allows more efficient use of TCP/IP addresses by allowing network designers greater freedom in assigning addresses.</p>
<h4>Classless Interdomain Routing (CIDR)</h4>
<p style="text-align: justify;">Variable-length subnet masking uses classless interdomain routing (CIDR) addressing. Table 1-1 lists the variable-length netmasks from 16 to 32, the CIDR representation form (/xx), and the hexadecimal and decimal equivalents. Refer to RFC 1878 for more information.</p>
<table>
<tbody>
<tr>
<td>IP addresses</td>
<td>Bits</td>
<td>Prefix</td>
<td>Subnet Mask</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>/32</td>
<td>255.255.255.255</td>
</tr>
<tr>
<td>2</td>
<td>1</td>
<td>/31</td>
<td>255.255.255.254</td>
</tr>
<tr>
<td>4</td>
<td>2</td>
<td>/30</td>
<td>255.255.255.252</td>
</tr>
<tr>
<td>8</td>
<td>3</td>
<td>/29</td>
<td>255.255.255.248</td>
</tr>
<tr>
<td>16</td>
<td>4</td>
<td>/28</td>
<td>255.255.255,240</td>
</tr>
<tr>
<td>32</td>
<td>5/</td>
<td>/27</td>
<td>255.255.255.224</td>
</tr>
<tr>
<td>64</td>
<td>6</td>
<td>/26</td>
<td>255.255.255.192</td>
</tr>
<tr>
<td>128</td>
<td>7</td>
<td>/25</td>
<td>255.255.255.128</td>
</tr>
<tr>
<td>256</td>
<td>8</td>
<td>/24</td>
<td>255.255.255.0</td>
</tr>
<tr>
<td>512</td>
<td>9</td>
<td>/23</td>
<td>255.255.254.0</td>
</tr>
<tr>
<td>1 k</td>
<td>10</td>
<td>/22</td>
<td>255.255.252.0</td>
</tr>
<tr>
<td>2 k</td>
<td>11</td>
<td>/21</td>
<td>255.255.248.0</td>
</tr>
<tr>
<td>4 k</td>
<td>12</td>
<td>/20</td>
<td>255.255.240.0</td>
</tr>
<tr>
<td>8 k</td>
<td>13</td>
<td>/19</td>
<td>255.255.224.0</td>
</tr>
<tr>
<td>16 k</td>
<td>14</td>
<td>/18</td>
<td>255.255.192.0</td>
</tr>
<tr>
<td>32 k</td>
<td>15/</td>
<td>/17</td>
<td>255.255.128.0</td>
</tr>
<tr>
<td>64 k</td>
<td>16</td>
<td>/16</td>
<td>255.255.0.0</td>
</tr>
</tbody>
</table>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/routing-a-brief-introduction/">Routing, a Brief Introduction</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/routing-a-brief-introduction/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">427</post-id>	</item>
		<item>
		<title>Bind Multiple IP Addresses on a Single Network Card IPv4 &#038; IPv6</title>
		<link>https://www.veriteknik.net.tr/en/bind-multiple-ip-addresses-on-a-single-network-card/</link>
					<comments>https://www.veriteknik.net.tr/en/bind-multiple-ip-addresses-on-a-single-network-card/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Wed, 02 May 2012 10:03:38 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ipv4]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=366</guid>

					<description><![CDATA[<p>The beauty of having multiple IP addresses on a single server is that you can run several services with different addressing. This way you can announce your FTP service on a different address and your HTTP on another. Below I&#8217;ll describe how to achieve this in Debian based and Red Hat based distros seperately. Using [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/bind-multiple-ip-addresses-on-a-single-network-card/">Bind Multiple IP Addresses on a Single Network Card IPv4 &#038; IPv6</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The beauty of having multiple IP addresses on a single server is that you can run several services with different addressing. This way you can announce your FTP service on a different address and your HTTP on another.</p>
<p>Below I&#8217;ll describe how to achieve this in Debian based and Red Hat based distros seperately.</p>
<p>Using Debian based distros (Ubuntu, Mint etc.), setting multiple IP addresses on a single network interface is simple.</p>
<p>What we will do is to edit the /etc/network/interfaces file.<br />
If you are using DHCP, then your file should look similar to this,</p>
<pre class="brush: text; gutter: true; first-line: 1">auto eth0
iface eth0 inet dhcp

auto eth0:0
iface eth0:0 inet dhcp
iface eth0:0 inet6 dhcp</pre>
<p>Here, the <strong>eth0:0</strong> is how we get the secondary IP address on the <strong>eth0</strong> device.</p>
<p>If you&#8217;re using a static IP address instead of DHCP, then your interfaces file should be like,</p>
<pre class="brush: text; gutter: true; first-line: 1">auto eth0
iface eth0 inet static
address 10.20.30.40
netmask 255.255.255.0
network 10.20.30.0
broadcast 10.20.30.255
gateway 10.20.30.1
dns-nameservers 8.8.8.8

iface eth0 inet6 static
address 2f00:7300:100::10
netmask 64

auto eth0:0
iface eth0:0 inet static
address 10.20.30.41
netmask 255.255.255.0

iface eth0:0 inet6 static
address 2f00:7300:100::11
netmask 64</pre>
<p>You can add as many as you want, such as <strong>eth0:1</strong>, <strong>eth0:2</strong> &#8230;</p>
<p>Sometimes when adding multiple IPv6 addresses on Debian systems, it is possible that you get an error. The current workaround for that is to enable and disable the device a couple of times. You can find the solution to that problem <a href="https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/617978" target="_blank">here</a>.</p>
<p>In Red Hat based distros (CentOS, Fedora etc.), the interfaces are edited through the directory <strong>/etc/sysconfig/network-scritps</strong>. Here we have multiple files, each pointing for a device. For instance, to have 2 additional IP&#8217;s on a single ethernet device (totaling 3 addresses) we should have 3 files as follows,</p>
<p><strong>/etc/sysconfig/network-scripts/ifcfg-eth0<br />
/etc/sysconfig/network-scripts/ifcfg-eth0:1<br />
/etc/sysconfig/network-scripts/ifcfg-eth0:2</strong></p>
<p>The main device file would be just a standard one, we don&#8217;t have to change anything with it.<br />
On the other hand, the <strong>ifcfg-eth0:1</strong> file should be similar to this,</p>
<pre class="brush: text; gutter: true; first-line: 1">NAME=""
BOOTPROTO=static
MACADDR=""
IPV6INIT=no
DEVICE=eth0:1
NETMASK=255.255.255.0
MTU=""
BROADCAST=10.20.30.255
ONPARENT=yes
IPADDR=10.20.30.41
NETWORK=10.20.30.0
IPV6INIT=yes
IPV6ADDR=2f00:7300:100::11
IPV6_DEFAULTGW=2f00:7300:100::1
ONBOOT=yes</pre>
<p>This would suffice. Don&#8217;t forget to restart your network services after adding the lines (or files) to with your appropriate settings.</p>
<p>For Debian : <strong>$ /etc/init.d/networking stop &amp;&amp; /etc/init.d/networking start</strong><br />
For Red Hat : <strong>$ service network restart</strong></p>
<p>For additional IPv6 addresses you should need to add IPV6ADDR_SECONDARIES=&#8221;&#8221; line to /etc/sysconfig/network-scripts/ifcfg-eth0 file</p>
<pre class="brush: text; gutter: true; first-line: 1">IPV6INIT=yes
IPV6ADDR=2f00:7300:1::2/64
IPV6ADDR_SECONDARIES="2f00:7300:1::3/64 2f00:7300:1::4/64 2f00:7300:1::fff4/64 2f00:7300:1::fff5/64"</pre>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/bind-multiple-ip-addresses-on-a-single-network-card/">Bind Multiple IP Addresses on a Single Network Card IPv4 &#038; IPv6</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/bind-multiple-ip-addresses-on-a-single-network-card/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">366</post-id>	</item>
	</channel>
</rss>
