Sponsored Content
Special Forums IP Networking Network interface layer in Linux kernel Post 302970434 by imort on Wednesday 6th of April 2016 01:12:09 PM
Old 04-06-2016
Hello

I'm not sure that I'd understand your question correctly.
Linux will use a existing routing table and route a packet to the network interface depending from that.
You can google for 'linux route table' yourself, can't post a link, sorry.

Let's me explain you with a little example.
You can have a route table looking like this:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.1.0     *               255.255.255.0   U     0      0        0 wifi0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

So if IP packet dst field will be in 192.168.1.0/24 network, it will be forwarded to eth0, and if it will be at 172.16.1.0/24 it will be forwarded to wifi0. Other way it will be sent to default gateway.

Did I answered your question?
You can find more relevant info here.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Network Interface

Hi ! Does anyone know how can i get information about my network interface ... if it works in half or full duplex mode !! Thx in adivance ! Witt (4 Replies)
Discussion started by: witt
4 Replies

2. UNIX for Advanced & Expert Users

Network interface in Linux kernel

Hi, I wrote some network modules to 2.6.x Linux kernel. Im useing sock_recvmsg / sock_sendmsg (linuxsrc/include/linux/net.h ) interface to receiving and sending data in TCP mode. Im cooperating with HTTP protocol and I have a question. Supose that I have buffer I have connection client -... (2 Replies)
Discussion started by: marcintom
2 Replies

3. Solaris

What are the kernel parameter of network interface in Solaris?

Hi gurus Could anybody tell me that what are the kernal parameter of network interface in solaris Regards (3 Replies)
Discussion started by: girish.batra
3 Replies

4. Solaris

configure zones to have different network interface and network

i need to configure a zone to use different interface (bge2) than global and have connected to completely different network switch & to use its own defaultrouter and hosts file .. is it possible ..if so ..how ? Thanks (9 Replies)
Discussion started by: skamal4u
9 Replies

5. UNIX and Linux Applications

Access to network interface (Mac-network)

Hi, I'm a italian student. For my thesis I develop a gateway with protocol 6lowpan. For that I must access to network interface to develope my personal stack based on standard 802.15.4. Can you help me? I need an explanation for that. (0 Replies)
Discussion started by: berny88
0 Replies

6. IP Networking

Network interface-

Hello, Please what's the difference between: AND Thank you so much (3 Replies)
Discussion started by: chercheur857
3 Replies

7. IP Networking

network interface -

Hello, Please, how can i create a network interface with a routable IP address on linux (ubuntu) ? AND How can i desactivate an interface? Thank you so much for help. (1 Reply)
Discussion started by: chercheur857
1 Replies

8. Solaris

No network cable But Network interface is UP and Running

I've one Netra 240 After changing main board and system configuration card reader, Network is not accessible any more, Network interfaces are always UP and Running even when there is no cable connected to Network interfaces. I tried to restart and plumb/unplumb with no luck. ifconfig -a... (7 Replies)
Discussion started by: samer.odeh
7 Replies

9. UNIX for Dummies Questions & Answers

Adding a network interface to a bonded interface

I have a RHEL 5 system with a bonded interface configure using only one network port (eth0). So I have config file for ifcfg-bond0 and ifcfg-eth. I'd like to configure eth5 to be the second SLAVE in the bond. My question is, after I modify ifcfg-eth5, can I add eth5 to the bond0 interface without... (1 Reply)
Discussion started by: westmoreland
1 Replies
NETWORK_NAMESPACES(7)					     Linux Programmer's Manual					     NETWORK_NAMESPACES(7)

NAME
network_namespaces - overview of Linux network namespaces DESCRIPTION
Network namespaces provide isolation of the system resources associated with networking: network devices, IPv4 and IPv6 protocol stacks, IP routing tables, firewall rules, the /proc/net directory (which is a symbolic link to /proc/PID/net), the /sys/class/net directory, various files under /proc/sys/net, port numbers (sockets), and so on. A physical network device can live in exactly one network namespace. When a network namespace is freed (i.e., when the last process in the namespace terminates), its physical network devices are moved back to the initial network namespace (not to the parent of the process). A virtual network (veth(4)) device pair provides a pipe-like abstraction that can be used to create tunnels between network namespaces, and can be used to create a bridge to a physical network device in another namespace. When a namespace is freed, the veth(4) devices that it contains are destroyed. Use of network namespaces requires a kernel that is configured with the CONFIG_NET_NS option. SEE ALSO
nsenter(1), unshare(1), clone(2), veth(4), proc(5), sysfs(5), namespaces(7), user_namespaces(7), brctl(8), ip(8), ip-address(8), ip- link(8), ip-netns(8), iptables(8), ovs-vsctl(8) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2018-02-02 NETWORK_NAMESPACES(7)
All times are GMT -4. The time now is 03:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy