Route all trafic for specific ip over specific network interface
I have a linux server that needs to get some routing. I'm fairly new at this and i don't find any clear source on google.
The setup should be simple:
All traffic to a server on ip 192.168.72.20 should be sent over interface 3.
All other interfaces don't matter at the moment.
Here you have the output for route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.72.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.72.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.72.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.72.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
192.168.72.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 192.168.72.12 0.0.0.0 UG 0 0 0 eth0
- 1Are you using the old fashioned ifconfig and route command or the modern ip commands? (old ones would be something like
route add -host 192.168.72.20 GW eth3_ip
) – Hennes Mar 29 '13 at 13:48
- i don't know, i guess the old ones, how can i check that? – Frederiek Mar 29 '13 at 13:58
Try:
ip route add 192.168.72.20/32 dev eth3
- 3Just a note: to permanently keep this configuration make sure you add it to
/etc/rc.local
or your distro's equivalent. It won't persist between reboots. – LawrenceC Mar 29 '13 at 16:32 - 1I tried this same format for mapping an IP to the wlan0 on Ubuntu 14.04 and got
RTNETLINK answers: Invalid argument
I had to remove the /** from the IP so I ended up with:sudo ip route add 192.168.50.15 dev wlan0
-- thought I'd mention that in case anyone else ran into this issue. Thank you for your answer ultrasawblade, it was helpful. – mason81 Jul 10 '15 at 14:54
- 3Do not forget
via <gateway_ip>
if the target IP is not directly reachable! – calandoa Dec 4 '17 at 15:00
Route all trafic for specific ip over specific network interface的更多相关文章
- How to block a specific IP Address using UFW
How to block a specific IP Address using UFW The key to blocking a specific IP address with UFW is t ...
- Docker无法启动 Could not find a free IP address range for interface 'docker0' 最方便的解决办法
阿里云的CentOS 6.5上安装Docker会无法启动,如果直接运行docker -d会看到错误提示:Could not find a free IP address range for inter ...
- do from a specific ip
ping -S 192.168.240.1 sohu.com telnet -b 192.168.240.1 sohu.com 80
- VIP - virtual IP address
virtual IP address (虚拟 IP 地址)1.是集群的ip地址,一个vip对应多个机器2.与群集关联的唯一 IP 地址 see wiki: A virtual IP address ( ...
- TCP/IP Protocol Architecture
原文: https://technet.microsoft.com/en-sg/library/cc958821.aspx 1. 主机到网络层 2.网络互连层(互连这个翻译好) ----------- ...
- Ubuntu中设置静态IP和DNS
在Ubuntu中设置静态IP共两步:1>设置IP:2>设置DNS1>设置IP 编辑 /etc/network/interface文件: sudo vi /etc/n ...
- Java获取ip地址的几种方法
以下内容介绍下java获取ip地址的几种思路. 1.直接利用java.net.InetAddress类获取,不过这种方法只在windows环境下有效,在linux环境下只能获取localhost地址( ...
- Ubuntu中设置静态IP和DNS(转载)
原文地址:http://blog.sina.com.cn/s/blog_669421480102v3bb.html VMware 中使用网络,对虚拟机设置静态IP:在Ubuntu中设置静态IP共两步: ...
- 树莓派(Debian)系统设置了静态IP之后还会获取动态IP的问题解决(scope global secondary eth0)
解决方法: 1.配置好静态IP在/etc/network/interface 2.关闭dhcp服务(不知道这个服务是干嘛的,明明是客户端还需要这个) sudo systemctl stop dhcpc ...
随机推荐
- 使用SyncNavigator轻松实现数据库异地同步、断点续传、异构同步
原文地址:https://blog.csdn.net/liushuijinger/article/details/7704410/ 最近一直在研究数据库同步的问题,在网上查了很多资料,也请教了很多人, ...
- FPGA程序编译后逻辑单元数为0
问题 FPGA代码写完后编译不报错,但是显示使用的逻辑单元数(Total logic elements)为0.当然程序也不工作. 我用的是Intel Altera FPGA,verilog语言,在Qu ...
- [资料]ObjectARX 2020参考指南翻译中文版
chm使用Google Chrome浏览器翻译,有些翻译不是很理想,因为2万5千多个html文件, 修正难度太大,所以只处理了一部分. 非常感谢 gzxl 辛苦肉眼修正一些翻译问题. 欢迎进入QQ群: ...
- LeetCode 496. 下一个更大元素 I(Next Greater Element I) 35
496. 下一个更大元素 I 496. Next Greater Element I 题目描述 给定两个没有重复元素的数组 nums1 和 nums2,其中 nums1 是 nums2 的子集.找到 ...
- PMBOK(第六版) PMP备考知识总汇!
记录本人学习PMBOK第六版的学习笔记. 备考知识总汇! PMBOK序章 PMP备考指南之相关事项介绍 PMP备考指南之第一章:引论 PMP备考指南之第二章:项目运作环境 PMP备考指南之第三章:项目 ...
- 【LEETCODE】51、数组分类,简单级别,题目:581,830,1010,665
package y2019.Algorithm.array; /** * @ClassName FindUnsortedSubarray * @Description TODO 581. Shorte ...
- 小程序发起get请求====post请求
- [LOJ#3119][Luogu5400][CTS2019]随机立方体(容斥+DP)
https://www.cnblogs.com/cjyyb/p/10900993.html #include<cstdio> #include<algorithm> #defi ...
- Oracle中的dual表简介
dual是一个虚拟表,用来构成select的语法规则,oracle保证dual里面永远只有一条记录.我们可以用它来做很多事情,如下: 1.查看当前用户,可以在 SQL Plus中执行下面语句 sql代 ...
- Helm命令日常使用
更换仓库 默认的stable仓库地址是:https://kubernetes-charts.storage.googleapis.com 若遇到Unable to get an update from ...