1 00:00:00,06 --> 00:00:04,04 - [Voiceover] Let's set up an Ubuntu host as a router. 2 00:00:04,04 --> 00:00:06,06 I'm assuming that you already have 3 00:00:06,06 --> 00:00:10,01 a second network interface card or NECs installed 4 00:00:10,01 --> 00:00:15,06 on your host either physically or virtually. 5 00:00:15,06 --> 00:00:20,02 Let me open a terminal and see if we have two NECs 6 00:00:20,02 --> 00:00:25,05 please note that this is our Ubuntu router VM 7 00:00:25,05 --> 00:00:36,05 Type ifconfig, press enter. 8 00:00:36,05 --> 00:00:41,02 The output shows eth0 and eth1 9 00:00:41,02 --> 00:00:44,06 which are the network interfaces. 10 00:00:44,06 --> 00:00:48,01 Eth0 and one are shorthands 11 00:00:48,01 --> 00:00:53,03 for ethernet cards zero and one which is the same as saying 12 00:00:53,03 --> 00:00:56,08 network interface card zero and one 13 00:00:56,08 --> 00:00:59,02 or NECs zero and one. 14 00:00:59,02 --> 00:01:02,09 Ethernet refers to a set of technical standards 15 00:01:02,09 --> 00:01:06,07 on local area networks or LANs. 16 00:01:06,07 --> 00:01:10,07 It specifies standards for NECs too 17 00:01:10,07 --> 00:01:15,03 and we often call a network interface card or NEC 18 00:01:15,03 --> 00:01:19,05 an ethernet card because of this reason. 19 00:01:19,05 --> 00:01:23,05 By the way the network addresses starting with 10 20 00:01:23,05 --> 00:01:26,03 we're using here is private. 21 00:01:26,03 --> 00:01:30,02 We use these addresses only within a local area network 22 00:01:30,02 --> 00:01:35,03 or LAN, which are never used as internet addresses. 23 00:01:35,03 --> 00:01:38,01 Another group of popular private addresses 24 00:01:38,01 --> 00:01:43,00 start with 192.168. 25 00:01:43,00 --> 00:01:49,08 Eth0 has an IP address of 10.0.0.6. 26 00:01:49,08 --> 00:01:55,02 The prefix inet here stands for internet. 27 00:01:55,02 --> 00:02:02,07 Eth1 has an IP address of 10.0.1.4. 28 00:02:02,07 --> 00:02:07,04 To turn our Ubuntu virtual machine or VM into a router 29 00:02:07,04 --> 00:02:12,07 we have to ensure eth0 belongs to one network 30 00:02:12,07 --> 00:02:17,00 while eth1 belongs to another. 31 00:02:17,00 --> 00:02:19,08 The network address of eth1 32 00:02:19,08 --> 00:02:22,08 looks slightly different from eth0 33 00:02:22,08 --> 00:02:27,07 because it belongs to another network or sub-net. 34 00:02:27,07 --> 00:02:35,04 In our example, the subnet mask is 255.255.255.0 35 00:02:35,04 --> 00:02:38,02 which means that we use the first three digits 36 00:02:38,02 --> 00:02:41,06 of an IP address as our subnet ID. 37 00:02:41,06 --> 00:02:48,07 Therefore 10.0.0 is a subnet ID of 10.0.0.6 38 00:02:48,07 --> 00:02:55,01 and 10.0.1 is a subnet ID of 10.0.1.4 39 00:02:55,01 --> 00:03:00,06 and they belong to different networks or subnets. 40 00:03:00,06 --> 00:03:04,06 Subnet here refers to a subdivided network. 41 00:03:04,06 --> 00:03:08,04 We divided our local area network into two here. 42 00:03:08,04 --> 00:03:15,01 One is 10 10.0.0 and the other is 10.0.1. 43 00:03:15,01 --> 00:03:21,00 I'm using Microsoft Azure to provision my VMs. 44 00:03:21,00 --> 00:03:28,03 I had to manually create the two subnets 10.0.0 and 10.0.1 45 00:03:28,03 --> 00:03:32,04 and associate them with eth0 and eth1 46 00:03:32,04 --> 00:03:36,01 respectively in my virtual network. 47 00:03:36,01 --> 00:03:41,09 Azure automatically configured my second NEC or eth1. 48 00:03:41,09 --> 00:03:43,05 Excellent job. 49 00:03:43,05 --> 00:03:46,03 You're now well on your way to the next step 50 00:03:46,03 --> 00:03:49,00 of setting up your Ubuntu to host as a router.