iT邦幫忙

0

ubuntu route問題

  • 分享至 

  • xImage

小弟我有一台網路攝影機是用實體網路線連接到我的電腦(ubuntu)
然後我的電腦只有一張網卡,但他有wifi功能,我都透過wifi連區網vnc進去
問題是ubuntu只能擇一
wifi 固網設 192.168.1.79
實體線 固網設 192.168.1.80
網路設攝影機 實體對連電腦 192.168.1.12

https://ithelp.ithome.com.tw/upload/images/20230118/20106033shJ0ESoph9.jpg
https://ithelp.ithome.com.tw/upload/images/20230118/201060331yLdK8MK1k.jpg
https://ithelp.ithome.com.tw/upload/images/20230118/20106033EOC8BHGTmF.jpg

我要連去那台電腦就必須透過wifi 連 79 進去,但他就抓不到12,
用實體線連80抓到12,但我外部的電腦就連不進去79

我聽說可以設電腦裡的route 去達到既能連到79又能連到80去抓12,
我參考https://blog.mirochiu.page/2017/06/ubunturoute.html 這篇去設定都會有問題
因為我對網路也不熟,有些步驟要改,也不太清楚要怎麼改,救大神幫忙

routing table列出來看看吧.
alanotmt iT邦新手 4 級 ‧ 2023-01-18 13:54:18 檢舉
已經貼了routing table 不過還是沒頭緒
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
alien663
iT邦研究生 5 級 ‧ 2023-01-18 15:22:18
最佳解答

靈魂小畫家上線
https://ithelp.ithome.com.tw/upload/images/20230118/20153982KyojB5KANH.jpg

我猜你的需求,應該是讓PC1提供router服務,讓PC2可以連到Carama。
這邊建議Carama那邊的網段和Wifi那邊的網段要分開。
將 Ubuntu 設定為 Router

看更多先前的回應...收起先前的回應...
alanotmt iT邦新手 4 級 ‧ 2023-01-18 16:14:51 檢舉

有畫出我的問題! 精闢! 那請問我server網卡wifi是否要設成wlan0
變成如下:

auto lo
iface lo inet loopback

# Client
auto eth0
iface eth0 inet static
netmask 255.255.255.0
address 192.168.1.228 #我連進去的主機IP
gateway 192.168.1.79

# Server
auto wlan0
iface wlan0 inet static
netmask 255.255.255.0
address 192.168.2.80
gateway 192.168.2.79
alien663 iT邦研究生 5 級 ‧ 2023-01-18 17:21:41 檢舉

ip address看一下,該是哪個就設定哪個

alanotmt iT邦新手 4 級 ‧ 2023-01-18 17:28:17 檢舉

有連上了!! 感謝!

hsiang11 iT邦好手 1 級 ‧ 2023-01-19 13:36:09 檢舉

好會畫 這真的是小畫家?

alien663 iT邦研究生 5 級 ‧ 2023-01-19 16:06:37 檢舉

這是PPT拉圖案而已啦 XD

我要發表回答

立即登入回答